public override void onMatchingFinish(int arg1) { KBEDebug.Log("onMatchingFinish, id is: " + id); if (isPlayer()) { Event.fireOut("onMatchingFinish", arg1); } }
/// <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()); }
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); }
// 玩家发送匹配请求 public void StartMatching(int map, int mode, int matchCode) { progress = 0; KBEDebug.Log("Account::Player Start Matching, id:" + id); baseEntityCall.regStartMatching(map, mode, matchCode); }
public void reachDestination() { KBEDebug.Log("send reachDestination info"); cellEntityCall.regReachDestination(); }
public void regGetProps(string propKey, int type) { KBEDebug.Log("send get orops info, type: " + type); cellEntityCall.regGetProps(propKey, type); }
public void onExitRoom(int suc) { KBEDebug.Log("onExitRoom"); ServerEvents.Instance.onExitRoom(suc); }
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); }