public void SendTo(Message _msg) { MessageBody_String _s = _msg.body as MessageBody_String; if (_s == null) { Utility.LogError("给平台发送的json字符串为空!"); return; } //特殊的部分 JsonData _jsonData = JsonMapper.ToObject(_s.content); switch (_jsonData["keyword"].Value) { //bugly需要双端注册 case "BuglyInit": BuglyInit.Init(_jsonData["appid"].Value); break; //return; } //派发给第三方 SendTo(_s.content); }
private void ServerConnect(Message _msg) { if (_msg.body == null) { return; } MessageBody_String _bb = _msg.body as MessageBody_String; if (_bb == null) { Utility.LogError("没有请求数据体或者消息结构错误:", _msg.body.key); return; } JsonData _data = JsonMapper.ToObject(_bb.content); if (_data["name"] == null) { Utility.LogError("必须指定服务器名称!"); return; } if (_data["type"] == null) { Utility.LogError("未指定需要连接的服务器类型!"); return; } if (_data["ip"] == null || _data["port"] == null) { Utility.LogError("参数错误!"); return; } Connect(_data); }
static int get_content(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); GameFramework.MessageBody_String obj = (GameFramework.MessageBody_String)o; string ret = obj.content; LuaDLL.lua_pushstring(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index content on a nil value")); } }
private void StartHotupdate(Message _msg) { MessageBody_String _s = _msg.body as MessageBody_String; LitJson.JsonData _data = LitJson.JsonMapper.ToObject(_s.content); if (_data["op"] == null) { return; } switch (_data["op"].Value) { case "total": total.OnStart(_data); break; case "filelist": filelist.OnStart(_data); break; } }
static int _CreateGameFramework_MessageBody_String(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 2) { string arg0 = ToLua.CheckString(L, 1); string arg1 = ToLua.CheckString(L, 2); GameFramework.MessageBody_String obj = new GameFramework.MessageBody_String(arg0, arg1); ToLua.PushObject(L, obj); return(1); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: GameFramework.MessageBody_String.New")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
private void ServerClose(Message _msg) { if (_msg.body == null) { return; } MessageBody_String _bb = _msg.body as MessageBody_String; if (_bb == null) { Utility.LogError("没有请求数据体或者消息结构错误:", _msg.body.key); return; } JsonData _data = JsonMapper.ToObject(_bb.content); if (_data["name"] == null) { Utility.LogError("必须指定服务器名称!"); return; } CloseConnect(_data["name"].Value); }