v2019.08.17

This commit is contained in:
pypy
2019-08-17 04:13:48 +09:00
parent 90f096c497
commit 095f9c0d59
5 changed files with 88 additions and 13 deletions

View File

@@ -11,6 +11,7 @@ namespace VRCX
public class VRCXStorage public class VRCXStorage
{ {
private static Dictionary<string, string> m_Storage = new Dictionary<string, string>(); private static Dictionary<string, string> m_Storage = new Dictionary<string, string>();
private static bool m_Dirty;
public static void Load() public static void Load()
{ {
@@ -26,6 +27,7 @@ namespace VRCX
{ {
lock (m_Storage) lock (m_Storage)
{ {
m_Dirty = true;
m_Storage.Clear(); m_Storage.Clear();
} }
} }
@@ -34,7 +36,11 @@ namespace VRCX
{ {
lock (m_Storage) lock (m_Storage)
{ {
Save(); if (m_Dirty)
{
m_Dirty = false;
Save();
}
} }
} }
@@ -42,6 +48,7 @@ namespace VRCX
{ {
lock (m_Storage) lock (m_Storage)
{ {
m_Dirty = true;
return m_Storage.Remove(key); return m_Storage.Remove(key);
} }
} }
@@ -60,6 +67,7 @@ namespace VRCX
{ {
lock (m_Storage) lock (m_Storage)
{ {
m_Dirty = true;
m_Storage[key] = value; m_Storage[key] = value;
} }
} }

View File

@@ -32,6 +32,7 @@ module.exports = {
'indent': 0, 'indent': 0,
'init-declarations': 0, 'init-declarations': 0,
'linebreak-style': 0, 'linebreak-style': 0,
'lines-around-comment': 0,
'max-depth': 0, 'max-depth': 0,
'max-len': 0, 'max-len': 0,
'max-lines': 0, 'max-lines': 0,

View File

@@ -84,9 +84,7 @@ if (window.CefSharp) {
this.Set(key, JSON.stringify(value)); this.Set(key, JSON.stringify(value));
}; };
VRCXStorage.Flush(); setInterval(() => VRCXStorage.Flush(), 5 * 60 * 1000);
setInterval(() => VRCXStorage.Flush(), 3 * 60 * 1000);
Noty.overrideDefaults({ Noty.overrideDefaults({
animation: { animation: {
@@ -3341,7 +3339,7 @@ if (window.CefSharp) {
VRCX, VRCX,
nextRefresh: 0, nextRefresh: 0,
isGameRunning: false, isGameRunning: false,
appVersion: '2019.08.16', appVersion: '2019.08.17',
latestAppVersion: '', latestAppVersion: '',
ossDialog: false ossDialog: false
}, },
@@ -4201,6 +4199,7 @@ if (window.CefSharp) {
API.$on('LOGIN', (args) => { API.$on('LOGIN', (args) => {
$app.feedTable.data = VRCXStorage.GetArray(`${args.ref.id}_feedTable`); $app.feedTable.data = VRCXStorage.GetArray(`${args.ref.id}_feedTable`);
$app.sweepFeed();
}); });
API.$on('USER:UPDATE', (args) => { API.$on('USER:UPDATE', (args) => {
@@ -4268,13 +4267,18 @@ if (window.CefSharp) {
}; };
$app.methods.addFeed = function (type, ref, extra) { $app.methods.addFeed = function (type, ref, extra) {
this.feedTable.data.push({ var array = this.feedTable.data;
if (array.length > 50000) {
array.length.splice(0, array.length - 10000);
}
array.push({
created_at: new Date().toJSON(), created_at: new Date().toJSON(),
type, type,
userId: ref.id, userId: ref.id,
displayName: ref.displayName, displayName: ref.displayName,
...extra ...extra
}); });
this.sweepFeed();
this.saveFeed(); this.saveFeed();
this.notifyMenu('feed'); this.notifyMenu('feed');
}; };
@@ -4287,12 +4291,48 @@ if (window.CefSharp) {
type: 'info', type: 'info',
callback: (action) => { callback: (action) => {
if (action === 'confirm') { if (action === 'confirm') {
this.feedTable.data = []; // 필터된 데이터만 삭제 하려면.. 허어
var T = this.feedTable;
T.data = T.data.filter((row) => !T.filters.every((filter) => {
if (filter.value) {
if (!Array.isArray(filter.value)) {
if (filter.filterFn) {
return filter.filterFn(row, filter);
}
return String(row[filter.prop]).toUpperCase().includes(String(filter.value).toUpperCase());
}
if (filter.value.length) {
if (filter.filterFn) {
return filter.filterFn(row, filter);
}
var prop = String(row[filter.prop]).toUpperCase();
return filter.value.some((v) => prop.includes(String(v).toUpperCase()));
}
}
return true;
}));
} }
} }
}); });
}; };
$app.methods.sweepFeed = function () {
var array = this.feedTable.data;
// 로그는 3일까지만 남김
var limit = new Date(Date.now() - 3 * 24 * 60 * 60 * 1000).toJSON();
var i = 0;
var j = array.length;
while (i < j &&
array[i].created_at < limit) {
++i;
}
if (i === j) {
this.feedTable.data = [];
} else if (i) {
array.splice(0, i);
}
};
// App: gameLog // App: gameLog
$app.data.lastLocation = ''; $app.data.lastLocation = '';
@@ -4361,6 +4401,7 @@ if (window.CefSharp) {
this.lastLocation = ctx.data; this.lastLocation = ctx.data;
} }
}); });
this.sweepGameLog();
this.updateSharedFeed(); this.updateSharedFeed();
this.notifyMenu('gameLog'); this.notifyMenu('gameLog');
}); });
@@ -4370,6 +4411,23 @@ if (window.CefSharp) {
}); });
}; };
$app.methods.sweepGameLog = function () {
var array = this.gameLogTable.data;
// 로그는 3일까지만 남김
var limit = new Date(Date.now() - 3 * 24 * 60 * 60 * 1000).toJSON();
var i = 0;
var j = array.length;
while (i < j &&
array[i].created_at < limit) {
++i;
}
if (i === j) {
this.gameLogTable.data = [];
} else if (i) {
array.splice(0, i);
}
};
$app.methods.updateDiscord = function () { $app.methods.updateDiscord = function () {
if (this.isGameRunning && if (this.isGameRunning &&
this.lastLocation) { this.lastLocation) {

View File

@@ -1216,7 +1216,7 @@
<el-dropdown trigger="click" @command="avatarDialogCommand" size="small"> <el-dropdown trigger="click" @command="avatarDialogCommand" size="small">
<el-button type="default" icon="el-icon-more" circle></el-button> <el-button type="default" icon="el-icon-more" circle></el-button>
<el-dropdown-menu #default="dropdown"> <el-dropdown-menu #default="dropdown">
<el-dropdown-item icon="el-icon-check" command="Assign Avatar">Select Avatar</el-dropdown-item> <el-dropdown-item icon="el-icon-check" command="Select Avatar">Select Avatar</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</div> </div>

View File

@@ -469,13 +469,21 @@ if (window.CefSharp) {
} else if (L.worldId) { } else if (L.worldId) {
var ref = API.world[L.worldId]; var ref = API.world[L.worldId];
if (ref) { if (ref) {
this.text = `${ref.name} #${L.instanceName} ${L.accessType}`; if (L.instanceId) {
this.text = `${ref.name} #${L.instanceName} ${L.accessType}`;
} else {
this.text = ref.name;
}
} else { } else {
API.getWorld({ API.getWorld({
worldId: L.worldId worldId: L.worldId
}).then((args) => { }).then((args) => {
if (L.tag === this.location) { if (L.tag === this.location) {
this.text = `${args.ref.name} #${L.instanceName} ${L.accessType}`; if (L.instanceId) {
this.text = `${args.ref.name} #${L.instanceName} ${L.accessType}`;
} else {
this.text = args.ref.name;
}
} }
return args; return args;
}); });
@@ -590,9 +598,9 @@ if (window.CefSharp) {
// 현재 날짜 시간 // 현재 날짜 시간
// 컨트롤러 배터리 상황 // 컨트롤러 배터리 상황
// -- // --
// OO is Let's Just H!!!!! [GPS] // OO is in Let's Just H!!!!! [GPS]
// OO has logged in [Online] // OO has logged in [Online] -> TODO: location
// OO has logged out [Offline] // OO has logged out [Offline] -> TODO: location
// OO has joined [OnPlayerJoined] // OO has joined [OnPlayerJoined]
// OO has left [OnPlayerLeft] // OO has left [OnPlayerLeft]
// [Moderation] // [Moderation]