mirror of
https://github.com/Ylianst/MeshAgent
synced 2026-02-06 11:43:15 +00:00
1. Added console.log/info helper
2. Fixed bug with user-sessions adding virtual uids incorrectly
This commit is contained in:
@@ -1202,7 +1202,21 @@ void Duktape_Console_Log(duk_context *ctx, void *chain, ILibDuktape_LogTypes log
|
||||
ILibChain_RunOnMicrostackThreadEx(chain, Duktape_Console_Log_Chain, data);
|
||||
}
|
||||
}
|
||||
void Duktape_Console_LogEx(duk_context *ctx, ILibDuktape_LogTypes logType, char *format, ...)
|
||||
{
|
||||
char dest[4096];
|
||||
int len = 0;
|
||||
va_list argptr;
|
||||
|
||||
if (ctx != NULL && format != NULL)
|
||||
{
|
||||
va_start(argptr, format);
|
||||
len += vsnprintf(dest + len, sizeof(dest) - len, format, argptr);
|
||||
va_end(argptr);
|
||||
}
|
||||
|
||||
Duktape_Console_Log(ctx, duk_ctx_chain(ctx), logType, dest, (duk_size_t)len);
|
||||
}
|
||||
char* ILibDuktape_String_AsWide(duk_context *ctx, duk_idx_t idx, duk_size_t *len)
|
||||
{
|
||||
char *src;
|
||||
|
||||
@@ -173,6 +173,7 @@ void duk_buffer_enable_autoclear(duk_context *ctx);
|
||||
void* Duktape_DynamicBuffer_Resize(duk_context *ctx, duk_idx_t idx, duk_size_t bufSize);
|
||||
|
||||
void Duktape_Console_Log(duk_context *ctx, void *chain, ILibDuktape_LogTypes logType, char *msg, duk_size_t msgLen);
|
||||
void Duktape_Console_LogEx(duk_context *ctx, ILibDuktape_LogTypes logType, char *format, ...);
|
||||
|
||||
typedef void(*ILibDuktape_NativeUncaughtExceptionHandler)(duk_context *ctx, char *msg, void *user);
|
||||
void ILibDuktape_SetNativeUncaughtExceptionHandler(duk_context *ctx, ILibDuktape_NativeUncaughtExceptionHandler handler, void *user);
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -691,6 +691,7 @@ function UserSessions()
|
||||
for (var key in ret)
|
||||
{
|
||||
ret[key] = { Username: ret[key], SessionId: key, State: 'Active', uid: this.getUid(ret[key]) };
|
||||
if (key.startsWith('pts/')) { delete ret[key]; }
|
||||
}
|
||||
}
|
||||
catch (e)
|
||||
@@ -702,10 +703,9 @@ function UserSessions()
|
||||
for (i in vids)
|
||||
{
|
||||
var u = this.getUsername(vids[i].uid);
|
||||
ret[i] = { Username: u, SessionId: vids[i].pid, State: 'Connected', uid: vids[i].uid, StationName: 'Xvfb-' + vids[i].uid };
|
||||
ret.push({ Username: u, SessionId: vids[i].pid, State: 'Connected', uid: vids[i].uid, StationName: 'Xvfb-' + vids[i].uid });
|
||||
}
|
||||
|
||||
|
||||
Object.defineProperty(ret, 'Active', { value: showActiveOnly(ret) });
|
||||
|
||||
if (cb)
|
||||
|
||||
Reference in New Issue
Block a user