MCPcopy Create free account
hub / github.com/MonaSolutions/MonaServer / followingType

Method followingType

MonaServer/sources/ScriptReader.cpp:58–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58UInt8 ScriptReader::followingType() {
59 if (_current == _end)
60 return END;
61
62 switch (lua_type(_pState, _current)) {
63 case LUA_TSTRING:
64 return STRING;
65 case LUA_TBOOLEAN:
66 return BOOLEAN;
67 case LUA_TNUMBER:
68 return NUMBER;
69 case LUA_TNIL:
70 return NIL;
71 case LUA_TTABLE: {
72 lua_getfield(_pState, _current, "__raw");
73 if (lua_isstring(_pState, -1)) {
74 lua_pop(_pState, 1);
75 return BYTES;
76 }
77 lua_pop(_pState, 1);
78
79 lua_getfield(_pState, _current, "__time");
80 if (lua_isnumber(_pState, -1)) {
81 lua_pop(_pState, 1);
82 return DATE;
83 }
84 lua_pop(_pState, 1);
85 }
86 }
87 return OTHER;
88}
89
90bool ScriptReader::readOne(UInt8 type,DataWriter& writer) {
91

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected