Ejemplo n.º 1
0
        public int logout()
        {
            JsonData jo = new JsonData();

            jo["action"] = "logout";
            return(JsonRpc.JsonRpc_callNativeMethod(jo.ToJson()));
        }
Ejemplo n.º 2
0
        public int gerVersion()
        {
            JsonData jo = new JsonData();

            jo["action"] = "getVersion";
            return(JsonRpc.JsonRpc_callNativeMethod(jo.ToJson()));
        }
Ejemplo n.º 3
0
        public int registerUser()
        {
            JsonData jo = new JsonData();

            jo["action"] = "registerUser";
            return(JsonRpc.JsonRpc_callNativeMethod(jo.ToJson()));
        }
Ejemplo n.º 4
0
        public int init(MatchVSResponse[] pMatchVSResponse, string channel, string platform, int gameid)
        {
            try {
                handler.handleString = handleJsonStringImp;
                handler.handleByte   = handleByteImp;
                Native.JsonRpc_regitCCallCsharp(ref handler);
                listener = new List <MatchVSResponse>();
                if (pMatchVSResponse != null)
                {
                    for (int i = 0; i < pMatchVSResponse.Length; i++)
                    {
                        if (pMatchVSResponse[i] != null)
                        {
                            listener.Add(pMatchVSResponse[i]);
                        }
                    }
                }

                JsonData jo = new JsonData();
                jo["action"]           = "init";
                jo["pMatchVSResponse"] = JsonMapper.ToObject(JsonUtil.toJson(pMatchVSResponse));
                jo["sChannel"]         = channel;
                jo["sPlatform"]        = platform;
                jo["iGameId"]          = gameid;
                //			jo["pIsPushQueue"] = 1;

                JsonRpc.JsonRpc_callNativeMethod(jo.ToJson());
            } catch (Exception e) {
                Log.w(e);
            }
            return(0);
        }
Ejemplo n.º 5
0
        public int sendFrameEvent(string cpProto)
        {
            JsonData jo = new JsonData();

            jo["action"]  = "sendFrameEvent";
            jo["cpProto"] = cpProto;
            return(JsonRpc.JsonRpc_callNativeMethod(jo.ToJson()));
        }
Ejemplo n.º 6
0
        public int leaveRoom(String payload)
        {
            JsonData jo = new JsonData();

            jo["action"]  = "leaveRoom";
            jo["cpProto"] = payload;
            return(JsonRpc.JsonRpc_callNativeMethod(jo.ToJson()));
        }
Ejemplo n.º 7
0
        public int getRoomList(MsRoomFilter roomFilter)
        {
            string   data = JsonMapper.ToJson(roomFilter);
            JsonData jo   = JsonUtil.toObject(data);

            jo["action"] = "getRoomList";
            return(JsonRpc.JsonRpc_callNativeMethod(jo.ToJson()));
        }
Ejemplo n.º 8
0
        public int joinOver(string cpProto)
        {
            JsonData jo = new JsonData();

            jo["action"]  = "joinOver";
            jo["cpProto"] = cpProto;
            return(JsonRpc.JsonRpc_callNativeMethod(jo.ToJson()));
        }
Ejemplo n.º 9
0
        public int joinRoomWithProperties(MsMatchInfo matchInfo, string userProfile)
        {
            JsonData jo = JsonUtil.toObject(JsonUtil.toJson(matchInfo));

            jo["action"]      = "joinRoomWithProperties";
            jo["userProfile"] = userProfile;
            return(JsonRpc.JsonRpc_callNativeMethod(JsonUtil.toJson(jo)));
        }
Ejemplo n.º 10
0
        public int setFrameSync(int frameRate)
        {
            JsonData jo = new JsonData();

            jo["action"]    = "setFrameSync";
            jo["frameRate"] = frameRate;
            return(JsonRpc.JsonRpc_callNativeMethod(jo.ToJson()));
        }
Ejemplo n.º 11
0
        public int setTimestamp(int priority, bool enable)
        {
            JsonData jo = new JsonData();

            jo["action"]   = "sendFrameEvent";
            jo["priority"] = priority;
            jo["enable"]   = enable;
            return(JsonRpc.JsonRpc_callNativeMethod(jo.ToJson()));
        }
Ejemplo n.º 12
0
        public int sendEvent(string pMsg)
        {
            JsonData jo = new JsonData();

            jo["action"] = "sendEvent";
            jo["pMsg"]   = pMsg;
            Debug.Log("[sendevent]: " + jo.ToJson());
            return(JsonRpc.JsonRpc_callNativeMethod(jo.ToJson()));
        }
Ejemplo n.º 13
0
        public int joinRoom(string roomID, string userProfile)
        {
            JsonData jo = new JsonData();

            jo["action"]      = "joinRoom";
            jo["roomID"]      = roomID;
            jo["userProfile"] = userProfile;
            return(JsonRpc.JsonRpc_callNativeMethod(jo.ToJson()));
        }
Ejemplo n.º 14
0
        public int kickPlayer(int userID, string cpProto)
        {
            JsonData jo = new JsonData();

            jo["action"]  = "kickPlayer";
            jo["userID"]  = userID;
            jo["cpProto"] = cpProto;
            return(JsonRpc.JsonRpc_callNativeMethod(jo.ToJson()));
        }
Ejemplo n.º 15
0
        public int joinRandomRoom(int iMaxPlayer, string strUserProfile)
        {
            JsonData jo = new JsonData();

            jo["action"]       = "joinRandomRoom";
            jo["iMaxPlayer"]   = iMaxPlayer;
            jo["sUserProfile"] = strUserProfile;
            return(JsonRpc.JsonRpc_callNativeMethod(jo.ToJson()));
        }
Ejemplo n.º 16
0
        public int subscribeEventGroup(string[] subGroups, string[] unsubGroups)
        {
            JsonData jo = new JsonData();

            jo["action"]      = "subscribeEventGroup";
            jo["subGroups"]   = JsonUtil.toObject(JsonUtil.toJson(subGroups));
            jo["unsubGroups"] = JsonUtil.toObject(JsonUtil.toJson(unsubGroups));
            return(JsonRpc.JsonRpc_callNativeMethod(jo.ToJson()));
        }
Ejemplo n.º 17
0
        public int createRoom(MsCreateRoomInfo roomInfo, string userProfile)
        {
            string   json = JsonMapper.ToJson(roomInfo);
            JsonData jo   = JsonUtil.toObject(json);

            jo["action"]      = "createRoom";
            jo["userProfile"] = userProfile;
            return(JsonRpc.JsonRpc_callNativeMethod(jo.ToJson()));
        }
Ejemplo n.º 18
0
        public int sendEventGroup(string cpProto, string[] groups)
        {
            JsonData jo = new JsonData();

            jo["action"]  = "sendEventGroup";
            jo["cpProto"] = cpProto;
            jo["groups"]  = JsonUtil.toObject(JsonUtil.toJson(groups));
            Debug.Log("[sendEventGroup]: " + jo.ToJson());
            return(JsonRpc.JsonRpc_callNativeMethod(jo.ToJson()));
        }
Ejemplo n.º 19
0
        public int sendEvent(int iType, string pMsg, int iTargetType, int[] pTargetUserId)
        {
            JsonData jo = new JsonData();

            jo["action"]        = "sendEvent";
            jo["iType"]         = iType;
            jo["pMsg"]          = pMsg;
            jo["iTargetType"]   = iTargetType;
            jo["pTargetUserId"] = JsonUtil.toObject(JsonUtil.toJson(pTargetUserId));
            Debug.Log("[sendevent]: " + jo.ToJson());
            return(JsonRpc.JsonRpc_callNativeMethod(jo.ToJson()));
        }
Ejemplo n.º 20
0
        public int login(int userid, string token, int gameid, int gameVersion, string appkey, string secretkey,
                         string deviceid, int gatewayid)
        {
            JsonData jo = new JsonData();

            jo["action"]       = "login";
            jo["iUserId"]      = userid;
            jo["sToken"]       = token;
            jo["iGameId"]      = gameid;
            jo["iGameVersion"] = gameVersion;
            jo["pAppKey"]      = appkey;
            jo["pSecretKey"]   = secretkey;
            jo["pDeviceId"]    = deviceid;
            jo["iGatewayId"]   = gatewayid;
            return(JsonRpc.JsonRpc_callNativeMethod(jo.ToJson()));
        }