public void RemoveMsgCallback(short receiveOpcode, MsgCallback callback) { MsgDispatcherCallback cc = new MsgDispatcherCallback(); cc.callback = callback; m_cMsgDispatcher.RemoveDispatcherObj((int)receiveOpcode, cc); }
//---------------------------------------无参数------------------------------- public void RegisterMsg(int nMsgID, MsgCallback callback) { if (callback != null) { AddMsg(nMsgID, callback); } }
public void SortOders(string orderid, MsgCallback msgCallback, ErrCallback errCallback = null) { Dictionary <string, string> param = new Dictionary <string, string>(); param.Add("orderid", orderid.ToString()); HttpPost("order/sort", param, msgCallback, errCallback); }
public void SearchUser(string weiboId, MsgCallback msgCallback, ErrCallback errCallback) { Dictionary <string, string> param = new Dictionary <string, string>(); param.Add("ID", GameBaseInfo.Instance.user.tel.ToString()); HttpPost("user/search", param, msgCallback, errCallback); }
/********************************* * 函数说明: 按优先级监听某消息 * 返 回 值: void * 参数说明: message@消息名,handler@消息响应函数 * 注意事项: 无 *********************************/ public void AddListener(int message, MsgCallback callback, int priority) { MsgHandler handler; handler.state = OperateState.None; handler.callback = callback; handler.priority = priority; List <MsgHandler> handlerList; if (!_handlerTable.TryGetValue(message, out handlerList)) { handlerList = new List <MsgHandler>(); handlerList.Add(handler); _handlerTable[message] = handlerList; } else { for (int i = 0; i < handlerList.Count; i++) { if (handlerList[i].priority < priority) { handlerList.Insert(i, handler); return; } } handlerList.Add(handler); } }
//get all items public void GetItems(MsgCallback msgCallback, ErrCallback errCallback = null) { Dictionary <string, string> param = new Dictionary <string, string>(); param.Add("ID", "0");//GameBaseInfo.Instance.user.tel.ToString()); HttpPost("item/search", param, msgCallback, errCallback); }
/********************************* * 函数说明: 删除回调 * 返 回 值: void * 参数说明: callback * 参数说明: callbackRepeat * 注意事项: 无 *********************************/ void RemoveDelay(MsgCallback callback, MsgCallbackRepeat callbackRepeat) { // 定义一个延时回调句柄 DelayMsgHandler delayMsgHandler = default(DelayMsgHandler); // 检查参数 if (callback == null && callbackRepeat == null) { return; } // 检查是否已经添加过 int iCount = delayHandlerList.Count; for (int i = 0; i < iCount; i++) { delayMsgHandler = delayHandlerList[i]; // 销毁状态的话不处理 if (delayMsgHandler.state == OperateState.Remove) { continue; } // 检查回调的状态 if ((callback != null && delayMsgHandler.callback == callback) || (callbackRepeat != null && delayMsgHandler.callbackRepeat == callbackRepeat)) { // 移除上一条消息 而不是直接更新消息是因为 防止在Update的时候添加消息,造成同一帧执行 delayMsgHandler.state = OperateState.Remove; continue; } } // 启用脚本 this.enabled = true; }
//移除一个指定type,code的消息回调函数 public static void RemoveMsgListener(MoudleType type, uint code, MsgCallback callback) { Dictionary <uint, MsgCallback> subDic = null; if (!_dic.TryGetValue(type, out subDic)) { Debug.LogWarning("移除监听失败:" + type.ToString() + " MoudleType 的委托字典不存在"); return; } if (!subDic.ContainsKey(code)) { Debug.LogWarning("移除监听失败:" + type.ToString() + " MoudleType ," + code.ToString() + " code 的委托不存在"); return; } subDic[code] -= callback; if (subDic[code] == null) { subDic.Remove(code); } if (subDic.Keys.Count == 0) { _dic.Remove(type); } }
//移除一个指定type,多个code的消息回调函数 public static void RemoveMsgListener(MoudleType type, uint[] codes, MsgCallback callback) { Dictionary <uint, MsgCallback> subDic = null; if (!_dic.TryGetValue(type, out subDic)) { Debug.LogWarning("移除监听失败:" + type.ToString() + " MoudleType 的委托字典不存在"); return; } for (int i = 0; i < codes.Length; i++) { if (!subDic.ContainsKey(codes[i])) { Debug.LogWarning("移除监听失败:" + type.ToString() + " MoudleType ," + codes[i].ToString() + " code 的委托不存在"); continue; } subDic[codes[i]] -= callback; if (subDic[codes[i]] == null) { subDic.Remove(codes[i]); } } if (subDic.Keys.Count == 0) { _dic.Remove(type); } }
public void CompleteOrder(int orderid, MsgCallback msgCallback, ErrCallback errCallback = null) { Dictionary <string, string> param = new Dictionary <string, string>(); param.Add("orderid", orderid.ToString()); HttpPost("order/complete", param, msgCallback, errCallback); }
//---------------------------------------------------------------------------- public void RegisterMsg <T>(int nMsgId, MsgCallback <T> callback) { if (callback != null) { AddMsg(nMsgId, callback); } }
public void SearchFriendBase(string phone, MsgCallback msgCallback, ErrCallback errCallback = null) { Dictionary <string, string> param = new Dictionary <string, string>(); param.Add("tel", phone); HttpPost("friend/base", param, msgCallback, errCallback); }
public void LoginUser(string userid, MsgCallback msgCallback, ErrCallback errCallback = null) { Dictionary <string, string> param = new Dictionary <string, string>(); param.Add("tel", userid); HttpPost("user/login", param, msgCallback, errCallback); }
//get all orders for langjian langti public void GetOders(long tel, MsgCallback msgCallback, ErrCallback errCallback = null) { Dictionary <string, string> param = new Dictionary <string, string>(); param.Add("tel", tel.ToString()); HttpPost("order/get", param, msgCallback, errCallback); }
/********************************* * 函数说明: 移除监听者 * 返 回 值: void * 参数说明: message@消息ID,handler@消息响应函数 * 注意事项: 无 *********************************/ public void RemoveListener(int message, MsgCallback callback) { List <MsgHandler> handlerList; if (_handlerTable.TryGetValue(message, out handlerList)) { for (int i = 0; i < handlerList.Count; i++) { MsgHandler handler = handlerList[i]; if (handler.callback == callback) { if (handler.state == OperateState.Handle) { handler.state = OperateState.Remove; } else { handlerList.Remove(handler); } break; } } if (handlerList.Count == 0) { _handlerTable.Remove(message); } } }
public void HttpPost(string url, WWWForm param, MsgCallback msgCallback, ErrCallback errCallback) { if (url != null) { Loadding.Instance.Show(true); GameEngine.Instance.StartCoroutine(postConnect(SimDef.SIM_URL + url, param, msgCallback, errCallback)); } }
public void AddMsgCallback(short receiveOpcode, MsgCallback callback, bool once) { MsgDispatcherCallback cc = new MsgDispatcherCallback(); cc.once = once; cc.callback = callback; m_cMsgDispatcher.AddDispatcherObj((int)receiveOpcode, cc); }
public void UserFriends(List <string> friends, MsgCallback msgCallback, ErrCallback errCallback = null) { Dictionary <string, string> param = new Dictionary <string, string>(); param.Add("friends", GameCore.Util.Instance.SerializeArray(friends)); param.Add("tel", GameBaseInfo.Instance.user.tel.ToString()); HttpPost("user/friend", param, msgCallback, errCallback); }
public void UpdateUserCode(int code, MsgCallback msgCallback, ErrCallback errCallback = null) { Dictionary <string, string> param = new Dictionary <string, string>(); param.Add("code", code.ToString()); param.Add("tel", GameBaseInfo.Instance.user.tel.ToString()); HttpPost("user/code", param, msgCallback, errCallback); }
public void Apply(int type, MsgCallback msgCallback, ErrCallback errCallback = null) { Dictionary <string, string> param = new Dictionary <string, string>(); param.Add("type", type.ToString()); param.Add("tel", GameBaseInfo.Instance.user.tel.ToString()); HttpPost("apply/apply", param, msgCallback, errCallback); }
public void ConfirmFriend(string friend, MsgCallback msgCallback, ErrCallback errCallback = null) { Dictionary <string, string> param = new Dictionary <string, string>(); param.Add("fri", friend); param.Add("tel", GameBaseInfo.Instance.user.tel.ToString()); HttpPost("friend/confirm", param, msgCallback, errCallback); }
//confirm order state public void UpdateOder(int[] orderids, long accept, MsgCallback msgCallback, ErrCallback errCallback = null) { Dictionary <string, string> param = new Dictionary <string, string>(); param.Add("orderids", GameCore.Util.Instance.SerializeArray(orderids)); param.Add("accept", accept.ToString()); HttpPost("order/confirm", param, msgCallback, errCallback); }
public void HttpGet(string url, MsgCallback msgCallback, ErrCallback errCallback) { if (url != null) { Loadding.Instance.Show(true); GameEngine.Instance.StartCoroutine(connect(NET_URL + url, msgCallback, errCallback)); } }
public void StateOder(string orderid, int state, MsgCallback msgCallback, ErrCallback errCallback = null) { Dictionary <string, string> param = new Dictionary <string, string>(); param.Add("orderid", orderid.ToString()); param.Add("state", state.ToString()); HttpPost("order/state", param, msgCallback, errCallback); }
public void UpdateBase(int bases, MsgCallback msgCallback, ErrCallback errCallback = null) { Dictionary <string, string> param = new Dictionary <string, string>(); param.Add("tel", GameBaseInfo.Instance.user.tel.ToString()); param.Add("ba", bases.ToString()); HttpPost("user/base", param, msgCallback, errCallback); }
public void CompleteOrders(int[] orderids, MsgCallback msgCallback, ErrCallback errCallback = null) { string ids = GameCore.Util.Instance.SerializeArray(orderids); Dictionary <string, string> param = new Dictionary <string, string>(); param.Add("orderids", ids); HttpPost("order/completes", param, msgCallback, errCallback); }
public void Charge(MsgCallback msgDel, ErrCallback errDel) { string url = "20150822/create/client"; WWWForm form = new WWWForm(); form.AddField("accountSid", SimDef.ACCOUNT_SID); form.AddField("appId", SimDef.APP_ID); HttpPost(url, form, msgDel, errDel); }
public void PostCallback(float delay, object msgArg, MsgCallback callback) { DelayCallback delayCallback = new DelayCallback(); delayCallback.callback = callback; delayCallback.msgArg = msgArg; delayCallback.delayTime = delay; delayCallback.currentTime = 0; delayCallbackList.Add(delayCallback); }
/// <summary> /// Required designer variable. /// </summary> public DocForm() { InitializeComponent(); // Cache a delegate for repeated reuse enableControls = new BooleanCallback(EnableControls); setMessage = new MsgCallback(SetMessage); setScript = new ScriptCallback(SetScript); setMaximumTable = new MaximumTableCallback(SetMaximumTable); }
public void RemoveMsgCallback(NetChannelType channel, short receiveOpcode, MsgCallback callback) { if (callback != null) { NetChannel netChannel = GetChannel(channel); if (netChannel == null) { return; } netChannel.RemoveMsgCallback(receiveOpcode, callback); } }
public void RegistMsg(msg_down_op_code f_id, MsgCallback f_func) { if (_msgDispatch.ContainsKey(f_id)) { _msgDispatch[f_id] += f_func; } else { _msgDispatch.Add(f_id, f_func); } _msgDispatch[f_id] = f_func; }
public Message (string msg, string speakerName, float delay=0f, float duration=6f, Texture portrait=null, AudioSource voice=null, MsgCallback callback=null) { this._voice = voice; this._msg = msg; this._speakerName = speakerName; this._portrait = portrait; this._start_t = Time.time + delay; this._duration = duration; this._callback = callback; if (_voice == null) { GameObject gv = Resources.Load ("DefaultVoice") as GameObject; GameObject clone = GameObject.Instantiate(gv) as GameObject; _voice = clone.GetComponent<AudioSource>(); } if (_portrait == null) { _portrait = Resources.Load("DefaultPortrait") as Texture; } }
public static void SetMessageCallback(MsgCallback Callback) { Traverser._msgCallback = Callback; }
public static extern int ECF_SetOnMsgAguarde(IntPtr ecfHandle, MsgCallback method);