44 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
			
		
		
	
	
			44 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
| /*
 | |
| 文件名:MarrySystem.nut
 | |
| 路径:Dps_A/ProjectClass/MarrySystem/MarrySystem.nut
 | |
| 创建日期:2024-10-01	10:02
 | |
| 文件用途:结婚系统
 | |
| */
 | |
| class Marry {
 | |
|     //包头
 | |
|     OP = 20078000;
 | |
| 
 | |
|     //查看是否结婚
 | |
|     function CheckMarryCallBack(SUser, Jso) {
 | |
|         // print("申请查看结婚信息的人是: " + SUser.GetCharacName());
 | |
|         local T = {
 | |
|             op = OP + 2,
 | |
|             Flag = false, //结婚返回true 未结婚返回flase
 | |
|         }
 | |
|         SUser.SendJso(T);
 | |
|     }
 | |
| 
 | |
|     //申请结婚
 | |
|     function RequestMarry(SUser, Jso) {
 | |
|         local PSUser = World.GetUserByName(Jso.Name);
 | |
|         if (PSUser) {
 | |
|             local T = {
 | |
|                 op = OP + 3,
 | |
|                 cid = SUser.GetCID(),
 | |
|                 cid2 = PSUser.GetCID(),
 | |
|             }
 | |
|             Socket.SendGateway(T);
 | |
|         }
 | |
|     }
 | |
| 
 | |
| 
 | |
|     constructor() {
 | |
|         //注册来自客户端的收包
 | |
|         ClientSocketPackFuncMap.rawset(OP + 1, CheckMarryCallBack.bindenv(this));
 | |
|         ClientSocketPackFuncMap.rawset(OP + 3, RequestMarry.bindenv(this));
 | |
|     }
 | |
| 
 | |
| }
 | |
| 
 | |
| 
 | |
| ProjectInitFuncMap.P_Marry <- Marry(); |