Example #1
0
 public override void onMatchingFinish(int arg1)
 {
     KBEDebug.Log("onMatchingFinish, id is: " + id);
     if (isPlayer())
     {
         Event.fireOut("onMatchingFinish", arg1);
     }
 }
Example #2
0
    /// <summary>
    /// 字符串转Unicode码
    /// </summary>
    /// <returns>The to unicode.</returns>
    /// <param name="value">Value.</param>
    public static string StringToUnicode(string value)
    {
        byte[]        bytes         = Encoding.Unicode.GetBytes(value);
        StringBuilder stringBuilder = new StringBuilder();

        for (int i = 0; i < bytes.Length; i += 2)
        {
            // 取两个字符,每个字符都是右对齐。
            stringBuilder.AppendFormat("u{0}{1}", bytes[i + 1].ToString("x").PadLeft(2, '0'), bytes[i].ToString("x").PadLeft(2, '0'));
        }
        KBEDebug.Log("player reg name is " + stringBuilder.ToString());
        return(stringBuilder.ToString());
    }
Example #3
0
    public void onConnectionState(bool success)
    {
        if (!success)
        {
            KBEDebug.LogError("connect(" + KBEngineApp.app.getInitArgs().ip + ":" + KBEngineApp.app.getInitArgs().port + ") is error! (连接错误)");
        }
        else
        {
            KBEDebug.Log("connect successfully, please wait...(连接成功,请等候...)");
        }

        ServerEvents.Instance.onConnectionState(success);
    }
Example #4
0
 // 玩家发送匹配请求
 public void StartMatching(int map, int mode, int matchCode)
 {
     progress = 0;
     KBEDebug.Log("Account::Player Start Matching, id:" + id);
     baseEntityCall.regStartMatching(map, mode, matchCode);
 }
Example #5
0
 public void reachDestination()
 {
     KBEDebug.Log("send reachDestination info");
     cellEntityCall.regReachDestination();
 }
Example #6
0
 public void regGetProps(string propKey, int type)
 {
     KBEDebug.Log("send get orops info, type: " + type);
     cellEntityCall.regGetProps(propKey, type);
 }
Example #7
0
 public void onExitRoom(int suc)
 {
     KBEDebug.Log("onExitRoom");
     ServerEvents.Instance.onExitRoom(suc);
 }
Example #8
0
 public void onLoginSuccessfully(UInt64 rndUUID, Int32 eid, KBEngine.Account account)
 {
     KBEDebug.Log("login is successfully!(登陆成功!)");
     KBEngine.Avatar m_Avatar = new KBEngine.Avatar(account);
     ServerEvents.Instance.onLoginSuccessfully(eid, m_Avatar);
 }