当前仓库属于关闭状态,部分功能使用受限,详情请查阅 仓库状态说明
1 Star 0 Fork 35

Passingwind/WEBQQ 4 CSharp
关闭

forked from Argo/WEBQQ 4 CSharp
关闭
 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
FokiteQQEvent.cs 17.29 KB
一键复制 编辑 原始数据 按行查看 历史
夏悸 提交于 2015-06-08 12:57 . init
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592
using System;
using System.Linq;
namespace FokiteQQcore_http://fokite.com/
{
/// <summary>
/// QQ被踢下线事件
/// </summary>
public sealed class FokiteQQKickEvent : EventArgs
{
private Object jsonengine = null;
/// <summary>
/// 可供处理的JSON格式
/// </summary>
public Object Jsonengine
{
get { return jsonengine; }
}
private String receiveresultset = String.Empty;
/// <summary>
/// 接收到的未解析文本
/// </summary>
public String Receiveresultset
{
get { return receiveresultset; }
}
/// <summary>
/// 获取被T下线原因
/// </summary>
public String KickReason
{
get {
if (Jsonengine == null){return String.Empty;}
//dynamic jsonengine = new System.Web.Script.Serialization.JavaScriptSerializer().DeserializeObject(url);
Dictionary<String, Object> dic = (Dictionary<String, Object>)jsonengine;
Object[] ects = (Object[])dic["result"];
dic = (Dictionary<String, Object>)ects[ects.LongLength - 1];
dic = (Dictionary<String, Object>)dic["value"];
return dic["reason"].ToString();
}
}
/// <summary>
/// 构造函数
/// </summary>
/// <param name="notresolvejssring">未解析的字符串</param>
/// <param name="jsstring">可供解析的字符串</param>
internal FokiteQQKickEvent(String notresolvejssring, Object jsstring)
{
this.jsonengine = jsstring;
this.receiveresultset = notresolvejssring;
}
}
/// <summary>
/// QQ好友状态改变事件
/// </summary>
public sealed class FokiteQQBuddiesStatusChangeEvent : EventArgs
{
private Object jsonengine = null;
/// <summary>
/// 可供处理的JSON格式
/// </summary>
public Object Jsonengine
{
get { return jsonengine; }
}
private String receiveresultset = String.Empty;
/// <summary>
/// 接收到的未解析文本
/// </summary>
public String Receiveresultset
{
get { return receiveresultset; }
}
/// <summary>
/// 改变状态的UIN号码
/// </summary>
public String Uin
{
get {
return runinfo["uin"].ToString();
}
}
/// <summary>
/// 得到改变状态的值
/// </summary>
public QQstatus Status
{
get
{
return (QQstatus)Enum.Parse(typeof(QQstatus), runinfo["status"].ToString(), true);
}
}
private readonly Hashtable runinfo = new Hashtable();
/// <summary>
/// 构造函数
/// </summary>
/// <param name="notresolvejssring">未解析的字符串</param>
/// <param name="jsstring">可供解析的字符串</param>
internal FokiteQQBuddiesStatusChangeEvent(String notresolvejssring, Object jsstring)
{
this.jsonengine = jsstring;
this.receiveresultset = notresolvejssring;
if (Jsonengine == null) { return ; }
Dictionary<String, Object> dic = (Dictionary<String, Object>)jsonengine;
Object[] ects = (Object[])dic["result"];
dic = (Dictionary<String, Object>)ects[0];
dic = (Dictionary<String, Object>)dic["value"];
runinfo.Add("uin", dic["uin"]);
runinfo.Add("status", dic["status"]);
// {"retcode":0,"result":[{"poll_type":"buddies_status_change","value":{"uin":3927610183,"status":"offline","client_type":1}}]}
//new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(;
}
}
/// <summary>
/// QQ群消息事件
/// </summary>
public sealed class FokiteQQGroupMessageEvent : EventArgs
{
private Object jsonengine = null;
/// <summary>
/// 可供处理的JSON格式
/// </summary>
public Object Jsonengine
{
get { return jsonengine; }
}
private String receiveresultset = String.Empty;
/// <summary>
/// 接收到的未解析文本
/// </summary>
public String Receiveresultset
{
get { return receiveresultset; }
}
private readonly Dictionary<String, Object> runinfo;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="notresolvejssring">未解析的字符串</param>
/// <param name="jsstring">可供解析的字符串</param>
internal FokiteQQGroupMessageEvent(String notresolvejssring, Object jsstring)
{
this.jsonengine = jsstring;
this.receiveresultset = notresolvejssring;
if (Jsonengine == null) { return; }
runinfo = (Dictionary<String, Object>)jsonengine;
Object[] ects = (Object[])runinfo["result"];
runinfo = (Dictionary<String, Object>)ects[0];
runinfo = (Dictionary<String, Object>)runinfo["value"];
ects = (Object[])runinfo["content"];
runinfo["contents"] = FokiteCore.receiveMsgFormat(ects, ref ects, true);
//runinfo["msgformat"] = ects;
}
/// <summary>
/// 群的Gcode
/// </summary>
public Object Groupcode
{
get
{
return runinfo["group_code"];
}
}
/// <summary>
/// 回复MSGID属性
/// </summary>
public Object ReplyMsgid
{
get
{
return runinfo["msg_id2"];
}
}
/// <summary>
/// 消息发送的时间
/// </summary>
public DateTime MessageSendTime
{
get
{
return FokiteCore.convertFromUnixTimestamp(Convert.ToDouble(runinfo["time"]));
}
}
/// <summary>
/// 群内发言人UIN
/// </summary>
public Object SendUin
{
get
{
return runinfo["send_uin"];
}
}
/// <summary>
/// 消息ID,可用于多条消息的拼接
/// </summary>
public Object Msgid
{
get
{
return runinfo["msg_id"];
}
}
/// <summary>
/// 群的UIN号码
/// </summary>
public Object Uin
{
get
{
return runinfo["from_uin"];
}
}
/// <summary>
/// 可以解码的消息IP
/// </summary>
public Object ReplyIp
{
get
{
return runinfo["reply_ip"];
}
}
/// <summary>
/// 消息内容
/// </summary>
public Object Content
{
get { return runinfo["contents"]; }
}
}
/// <summary>
/// QQ消息事件
/// </summary>
public sealed class FokiteQQMessageEvent : EventArgs
{
private Object jsonengine = null;
/// <summary>
/// 可供处理的JSON格式
/// </summary>
public Object Jsonengine
{
get { return jsonengine; }
}
private String receiveresultset = String.Empty;
/// <summary>
/// 接收到的未解析文本
/// </summary>
public String Receiveresultset
{
get { return receiveresultset; }
}
private readonly Hashtable runinfo = new Hashtable();
/// <summary>
/// 获取消息内容
/// </summary>
public String Messagecontent
{
get
{
return runinfo["content"].ToString();
}
}
/// <summary>
/// 获取消息字体、色彩等格式信息
/// </summary>
public Object[] Messageformatinfo()
{
return (Object[])runinfo["msgformat"];
}
/// <summary>
/// 回复MSGID属性
/// </summary>
public Int64 ReplyMsgid
{
get
{
return Convert.ToInt64(runinfo["msg_id2"]);
}
}
/// <summary>
/// 发送人的UID
/// </summary>
public Int64 Uin
{
get
{
return Convert.ToInt64(runinfo["from_uin"]);
}
}
/// <summary>
/// 消息发送的时间
/// </summary>
public DateTime MessageSendTime
{
get
{
return (DateTime) runinfo["time"];
}
}
/// <summary>
/// 构造函数
/// </summary>
/// <param name="notresolvejssring">未解析的字符串</param>
/// <param name="jsstring">可供解析的字符串</param>
internal FokiteQQMessageEvent(String notresolvejssring, Object jsstring)
{
this.jsonengine = jsstring;
this.receiveresultset = notresolvejssring;
if (Jsonengine == null) { return ; }
Dictionary<String, Object> dic = (Dictionary<String, Object>)jsonengine;
Object[] ects = (Object[])dic["result"];
dic = (Dictionary<String, Object>)ects[0];
dic = (Dictionary<String, Object>)dic["value"];
runinfo["from_uin"] = dic["from_uin"];
runinfo["msg_id2"] = dic["msg_id2"];
runinfo["time"] = FokiteCore.convertFromUnixTimestamp(Convert.ToDouble(dic["time"]));
ects = (Object[])dic["content"];
runinfo["content"] = FokiteCore.receiveMsgFormat(ects, ref ects, true);
runinfo["msgformat"] = ects;
}
}
/// <summary>
/// QQ系统消息事件
/// </summary>
public sealed class FokiteQQSystemMessageEvent : EventArgs
{
private Object jsonengine = null;
private String receiveresultset = String.Empty;
#region FokiteQQMessageEventInterface 成员
/// <summary>
/// 可供处理的JSON格式
/// </summary>
public Object Jsonengine
{
get { return jsonengine; }
}
/// <summary>
/// 接收到的未解析文本
/// </summary>
public String Receiveresultset
{
get { return receiveresultset; }
}
#endregion
/// <summary>
/// 构造函数
/// </summary>
/// <param name="notresolvejssring">未解析的字符串</param>
/// <param name="jsstring">可供解析的字符串</param>
internal FokiteQQSystemMessageEvent(String notresolvejssring, Object jsstring)
{
this.jsonengine = jsstring;
this.receiveresultset = notresolvejssring;
}
}
/// <summary>
/// QQ抖动事件
/// </summary>
public sealed class FokiteQQShakeMessageEvent : EventArgs
{
private Object jsonengine = null;
/// <summary>
/// 可供处理的JSON格式
/// </summary>
public Object Jsonengine
{
get { return jsonengine; }
}
private String receiveresultset = String.Empty;
/// <summary>
/// 接收到的未解析文本
/// </summary>
public String Receiveresultset
{
get { return receiveresultset; }
}
/// <summary>
/// 抖动人的UID
/// </summary>
public Object Uin
{
get
{
return runinfo["from_uin"];
}
}
/// <summary>
/// 回复消息的ID
/// </summary>
public Object ReplyMsgid
{
get
{
return runinfo["msg_id2"];
}
}
private readonly Dictionary<String, Object> runinfo;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="notresolvejssring">未解析的字符串</param>
/// <param name="jsstring">可供解析的字符串</param>
internal FokiteQQShakeMessageEvent(String notresolvejssring, Object jsstring)
{
this.jsonengine = jsstring;
this.receiveresultset = notresolvejssring;
if (Jsonengine == null) { return ; }
runinfo = (Dictionary<String, Object>)jsonengine;
Object[] ects = (Object[])runinfo["result"];
runinfo = (Dictionary<String, Object>)ects[0];
runinfo = (Dictionary<String, Object>)runinfo["value"];
}
}
/// <summary>
/// QQ文件传送事件
/// </summary>
public sealed class FokiteQQFileMessageEvent : EventArgs
{
private Object jsonengine = null;
/// <summary>
/// 可供处理的JSON格式
/// </summary>
public Object Jsonengine
{
get { return jsonengine; }
}
private String receiveresultset = String.Empty;
/// <summary>
/// 接收到的未解析文本
/// </summary>
public String Receiveresultset
{
get { return receiveresultset; }
}
/// <summary>
/// 构造函数
/// </summary>
/// <param name="notresolvejssring">未解析的字符串</param>
/// <param name="jsstring">可供解析的字符串</param>
internal FokiteQQFileMessageEvent(String notresolvejssring, Object jsstring)
{
this.jsonengine = jsstring;
this.receiveresultset = notresolvejssring;
}
}
/// <summary>
/// 正在输入响应类
/// </summary>
public sealed class FokiteQQInputNotify : EventArgs
{
private Object jsonengine = null;
/// <summary>
/// 可供处理的JSON格式
/// </summary>
public Object Jsonengine
{
get { return jsonengine; }
}
private String receiveresultset = String.Empty;
/// <summary>
/// 接收到的未解析文本
/// </summary>
public String Receiveresultset
{
get { return receiveresultset; }
}
/// <summary>
/// 正在输入好友的UID
/// </summary>
public Object Uin
{
get
{
return runinfo["from_uin"];
}
}
/// <summary>
/// 回复消息的ID
/// </summary>
public Object ReplyMsgid
{
get
{
return runinfo["msg_id2"];
}
}
private readonly Dictionary<String, Object> runinfo;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="notresolvejssring">未解析的字符串</param>
/// <param name="jsstring">可供解析的字符串</param>
internal FokiteQQInputNotify(String notresolvejssring, Object jsstring)
{
this.jsonengine = jsstring;
this.receiveresultset = notresolvejssring;
if (Jsonengine == null) { return ; }
runinfo = (Dictionary<String, Object>)jsonengine;
Object[] ects = (Object[])runinfo["result"];
runinfo = (Dictionary<String, Object>)ects[0];
runinfo = (Dictionary<String, Object>)runinfo["value"];
}
}
/// <summary>
/// 所有消息轮询事件响应类
/// </summary>
public sealed class FokiteQQEventArgsPollMsg : EventArgs
{
private Object jsonengine = null;
/// <summary>
/// 可供处理的JSON格式
/// </summary>
public Object Jsonengine
{
get { return jsonengine; }
}
private String receiveresultset = String.Empty;
/// <summary>
/// 接收到的未解析文本
/// </summary>
public String Receiveresultset
{
get { return receiveresultset; }
}
/// <summary>
/// 消息轮询事件响应类
/// </summary>
public FokiteQQEventArgsPollMsg()
{
}
/// <summary>
/// 消息轮询事件响应类
/// </summary>
/// <param name="receiveresultsets">接收到的原始消息文本</param>
/// <param name="jsonengines">序列化的JSON访问</param>
internal FokiteQQEventArgsPollMsg(String receiveresultsets, Object jsonengines)
{
this.receiveresultset = receiveresultsets;
this.jsonengine = jsonengines;
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/PassingWind/WEBQQ-4-CSharp.git
git@gitee.com:PassingWind/WEBQQ-4-CSharp.git
PassingWind
WEBQQ-4-CSharp
WEBQQ 4 CSharp
master

搜索帮助