mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-16 13:23:52 +02:00
v2019.08.17
This commit is contained in:
@@ -11,6 +11,7 @@ namespace VRCX
|
||||
public class VRCXStorage
|
||||
{
|
||||
private static Dictionary<string, string> m_Storage = new Dictionary<string, string>();
|
||||
private static bool m_Dirty;
|
||||
|
||||
public static void Load()
|
||||
{
|
||||
@@ -26,6 +27,7 @@ namespace VRCX
|
||||
{
|
||||
lock (m_Storage)
|
||||
{
|
||||
m_Dirty = true;
|
||||
m_Storage.Clear();
|
||||
}
|
||||
}
|
||||
@@ -34,7 +36,11 @@ namespace VRCX
|
||||
{
|
||||
lock (m_Storage)
|
||||
{
|
||||
Save();
|
||||
if (m_Dirty)
|
||||
{
|
||||
m_Dirty = false;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +48,7 @@ namespace VRCX
|
||||
{
|
||||
lock (m_Storage)
|
||||
{
|
||||
m_Dirty = true;
|
||||
return m_Storage.Remove(key);
|
||||
}
|
||||
}
|
||||
@@ -60,6 +67,7 @@ namespace VRCX
|
||||
{
|
||||
lock (m_Storage)
|
||||
{
|
||||
m_Dirty = true;
|
||||
m_Storage[key] = value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ module.exports = {
|
||||
'indent': 0,
|
||||
'init-declarations': 0,
|
||||
'linebreak-style': 0,
|
||||
'lines-around-comment': 0,
|
||||
'max-depth': 0,
|
||||
'max-len': 0,
|
||||
'max-lines': 0,
|
||||
|
||||
70
html/app.js
70
html/app.js
@@ -84,9 +84,7 @@ if (window.CefSharp) {
|
||||
this.Set(key, JSON.stringify(value));
|
||||
};
|
||||
|
||||
VRCXStorage.Flush();
|
||||
|
||||
setInterval(() => VRCXStorage.Flush(), 3 * 60 * 1000);
|
||||
setInterval(() => VRCXStorage.Flush(), 5 * 60 * 1000);
|
||||
|
||||
Noty.overrideDefaults({
|
||||
animation: {
|
||||
@@ -3341,7 +3339,7 @@ if (window.CefSharp) {
|
||||
VRCX,
|
||||
nextRefresh: 0,
|
||||
isGameRunning: false,
|
||||
appVersion: '2019.08.16',
|
||||
appVersion: '2019.08.17',
|
||||
latestAppVersion: '',
|
||||
ossDialog: false
|
||||
},
|
||||
@@ -4201,6 +4199,7 @@ if (window.CefSharp) {
|
||||
|
||||
API.$on('LOGIN', (args) => {
|
||||
$app.feedTable.data = VRCXStorage.GetArray(`${args.ref.id}_feedTable`);
|
||||
$app.sweepFeed();
|
||||
});
|
||||
|
||||
API.$on('USER:UPDATE', (args) => {
|
||||
@@ -4268,13 +4267,18 @@ if (window.CefSharp) {
|
||||
};
|
||||
|
||||
$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(),
|
||||
type,
|
||||
userId: ref.id,
|
||||
displayName: ref.displayName,
|
||||
...extra
|
||||
});
|
||||
this.sweepFeed();
|
||||
this.saveFeed();
|
||||
this.notifyMenu('feed');
|
||||
};
|
||||
@@ -4287,12 +4291,48 @@ if (window.CefSharp) {
|
||||
type: 'info',
|
||||
callback: (action) => {
|
||||
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.data.lastLocation = '';
|
||||
@@ -4361,6 +4401,7 @@ if (window.CefSharp) {
|
||||
this.lastLocation = ctx.data;
|
||||
}
|
||||
});
|
||||
this.sweepGameLog();
|
||||
this.updateSharedFeed();
|
||||
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 () {
|
||||
if (this.isGameRunning &&
|
||||
this.lastLocation) {
|
||||
|
||||
@@ -1216,7 +1216,7 @@
|
||||
<el-dropdown trigger="click" @command="avatarDialogCommand" size="small">
|
||||
<el-button type="default" icon="el-icon-more" circle></el-button>
|
||||
<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>
|
||||
</div>
|
||||
|
||||
18
html/vr.js
18
html/vr.js
@@ -469,13 +469,21 @@ if (window.CefSharp) {
|
||||
} else if (L.worldId) {
|
||||
var ref = API.world[L.worldId];
|
||||
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 {
|
||||
API.getWorld({
|
||||
worldId: L.worldId
|
||||
}).then((args) => {
|
||||
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;
|
||||
});
|
||||
@@ -590,9 +598,9 @@ if (window.CefSharp) {
|
||||
// 현재 날짜 시간
|
||||
// 컨트롤러 배터리 상황
|
||||
// --
|
||||
// OO is Let's Just H!!!!! [GPS]
|
||||
// OO has logged in [Online]
|
||||
// OO has logged out [Offline]
|
||||
// OO is in Let's Just H!!!!! [GPS]
|
||||
// OO has logged in [Online] -> TODO: location
|
||||
// OO has logged out [Offline] -> TODO: location
|
||||
// OO has joined [OnPlayerJoined]
|
||||
// OO has left [OnPlayerLeft]
|
||||
// [Moderation]
|
||||
|
||||
Reference in New Issue
Block a user