home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2004 July & August / Gamestar_64_2004-07-08_dvd.iso / Patche / ut2004-winpatch3204.exe / UT2004-Patch / System / UnrealGame.u / ScriptText25.TextBuffer < prev    next >
Unknown  |  2004-05-10  |  13.1 KB

view JSON data     |     view as text     |     open on a Mac     |     open on a PC

This file was not able to be converted.
This format is not currently supported by dexvert.

ConfidenceProgramDetectionMatch TypeSupport
100% file data default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 00 00 00 00 00 00 00 | 7f d1 01 2f 2f 3d 3d 3d |........|...//===|
|00000010| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000020| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000030| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000040| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000050| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 0d 0a 2f 2f 09 |========|===..//.|
|00000060| 43 72 65 61 74 65 64 20 | 6f 6e 3a 20 30 38 2f 32 |Created |on: 08/2|
|00000070| 39 2f 32 30 30 33 0d 0a | 2f 2f 09 55 6e 72 65 61 |9/2003..|//.Unrea|
|00000080| 6c 50 6c 61 79 65 72 43 | 68 61 74 4d 61 6e 61 67 |lPlayerC|hatManag|
|00000090| 65 72 20 69 73 20 72 65 | 73 70 6f 6e 73 69 62 6c |er is re|sponsibl|
|000000a0| 65 20 66 6f 72 20 74 72 | 61 63 6b 69 6e 67 20 65 |e for tr|acking e|
|000000b0| 61 63 68 20 70 6c 61 79 | 65 72 27 73 20 63 68 61 |ach play|er's cha|
|000000c0| 74 20 70 72 65 66 65 72 | 65 6e 63 65 73 20 61 6e |t prefer|ences an|
|000000d0| 64 20 72 65 73 74 72 69 | 63 74 69 6f 6e 73 2e 0d |d restri|ctions..|
|000000e0| 0a 2f 2f 20 20 57 68 65 | 6e 20 61 20 63 6c 69 65 |.// Whe|n a clie|
|000000f0| 6e 74 20 6a 6f 69 6e 73 | 20 74 68 65 20 67 61 6d |nt joins| the gam|
|00000100| 65 2c 20 61 20 6e 65 77 | 20 55 6e 72 65 61 6c 50 |e, a new| UnrealP|
|00000110| 6c 61 79 65 72 43 68 61 | 74 4d 61 6e 61 67 65 72 |layerCha|tManager|
|00000120| 20 6f 62 6a 65 63 74 20 | 69 73 20 73 70 61 77 6e | object |is spawn|
|00000130| 65 64 20 66 6f 72 20 74 | 68 61 74 20 70 6c 61 79 |ed for t|hat play|
|00000140| 65 72 2c 20 61 6e 64 20 | 72 65 70 6c 69 63 61 74 |er, and |replicat|
|00000150| 65 64 0d 0a 2f 2f 20 20 | 74 6f 20 74 68 65 20 63 |ed..// |to the c|
|00000160| 6c 69 65 6e 74 2e 20 20 | 20 57 68 65 6e 20 74 68 |lient. | When th|
|00000170| 65 20 55 6e 72 65 61 6c | 50 6c 61 79 65 72 43 68 |e Unreal|PlayerCh|
|00000180| 61 74 4d 61 6e 61 67 65 | 72 20 6f 62 6a 65 63 74 |atManage|r object|
|00000190| 20 61 72 72 69 76 65 73 | 20 6f 6e 20 74 68 65 20 | arrives| on the |
|000001a0| 63 6c 69 65 6e 74 2c 20 | 69 74 20 72 65 71 75 65 |client, |it reque|
|000001b0| 73 74 73 20 61 20 6c 69 | 73 74 20 6f 66 20 70 6c |sts a li|st of pl|
|000001c0| 61 79 65 72 20 68 61 73 | 68 65 73 0d 0a 2f 2f 20 |ayer has|hes..// |
|000001d0| 20 66 6f 72 20 61 6c 6c | 20 70 6c 61 79 65 72 73 | for all| players|
|000001e0| 20 63 75 72 72 65 6e 74 | 6c 79 20 63 6f 6e 6e 65 | current|ly conne|
|000001f0| 63 74 65 64 20 74 6f 20 | 74 68 65 20 73 65 72 76 |cted to |the serv|
|00000200| 65 72 2e 0d 0a 2f 2f 20 | 20 54 68 65 20 68 61 73 |er...// | The has|
|00000210| 68 65 73 20 72 65 63 65 | 69 76 65 64 20 66 72 6f |hes rece|ived fro|
|00000220| 6d 20 74 68 65 20 73 65 | 72 76 65 72 20 61 72 65 |m the se|rver are|
|00000230| 20 6d 61 74 63 68 65 64 | 20 61 67 61 69 6e 73 74 | matched| against|
|00000240| 20 74 68 65 20 6c 6f 63 | 61 6c 20 63 6c 69 65 6e | the loc|al clien|
|00000250| 74 27 73 20 73 74 6f 72 | 65 64 20 72 65 73 74 72 |t's stor|ed restr|
|00000260| 69 63 74 69 6f 6e 73 2e | 20 20 57 68 65 6e 20 61 |ictions.| When a|
|00000270| 20 6d 61 74 63 68 20 69 | 73 0d 0a 2f 2f 20 20 66 | match i|s..// f|
|00000280| 6f 75 6e 64 2c 20 55 6e | 72 65 61 6c 50 6c 61 79 |ound, Un|realPlay|
|00000290| 65 72 43 68 61 74 4d 61 | 6e 61 67 65 72 20 75 70 |erChatMa|nager up|
|000002a0| 64 61 74 65 73 20 74 68 | 65 20 73 65 72 76 65 72 |dates th|e server|
|000002b0| 27 73 20 63 6f 70 79 20 | 6f 66 20 74 68 65 20 74 |'s copy |of the t|
|000002c0| 72 61 63 6b 69 6e 67 20 | 69 6e 66 6f 72 6d 61 74 |racking |informat|
|000002d0| 69 6f 6e 20 77 69 74 68 | 20 74 68 65 20 63 6c 69 |ion with| the cli|
|000002e0| 65 6e 74 27 73 20 72 65 | 73 74 72 69 63 74 69 6f |ent's re|strictio|
|000002f0| 6e 2e 0d 0a 2f 2f 0d 0a | 2f 2f 20 20 54 68 65 72 |n...//..|// Ther|
|00000300| 65 61 66 74 65 72 2c 20 | 77 68 65 6e 20 74 68 65 |eafter, |when the|
|00000310| 20 63 6c 69 65 6e 74 27 | 73 20 63 6f 70 79 20 6f | client'|s copy o|
|00000320| 66 20 74 68 65 20 55 6e | 72 65 61 6c 50 6c 61 79 |f the Un|realPlay|
|00000330| 65 72 43 68 61 74 4d 61 | 6e 61 67 65 72 20 6f 62 |erChatMa|nager ob|
|00000340| 6a 65 63 74 20 69 73 20 | 6e 6f 74 69 66 69 65 64 |ject is |notified|
|00000350| 20 74 68 61 74 20 61 20 | 6e 65 77 20 63 6c 69 65 | that a |new clie|
|00000360| 6e 74 20 68 61 73 0d 0a | 2f 2f 20 20 63 6f 6e 6e |nt has..|// conn|
|00000370| 65 63 74 65 64 2c 20 69 | 74 20 72 65 71 75 65 73 |ected, i|t reques|
|00000380| 74 73 20 74 68 65 20 68 | 61 73 68 20 69 6e 66 6f |ts the h|ash info|
|00000390| 72 6d 61 74 69 6f 6e 20 | 66 6f 72 20 74 68 61 74 |rmation |for that|
|000003a0| 20 70 6c 61 79 65 72 20 | 69 6e 20 6f 72 64 65 72 | player |in order|
|000003b0| 20 74 6f 20 6d 61 74 63 | 68 20 69 74 20 61 67 61 | to matc|h it aga|
|000003c0| 69 6e 73 74 20 74 68 65 | 20 63 6c 69 65 6e 74 27 |inst the| client'|
|000003d0| 73 20 73 74 6f 72 65 64 | 0d 0a 2f 2f 20 20 72 65 |s stored|..// re|
|000003e0| 73 74 72 69 63 74 69 6f | 6e 73 2e 0d 0a 2f 2f 0d |strictio|ns...//.|
|000003f0| 0a 2f 2f 09 57 72 69 74 | 74 65 6e 20 62 79 20 52 |.//.Writ|ten by R|
|00000400| 6f 6e 20 50 72 65 73 74 | 65 6e 62 61 63 6b 0d 0a |on Prest|enback..|
|00000410| 2f 2f 09 a9 20 32 30 30 | 33 2c 20 45 70 69 63 20 |//.. 200|3, Epic |
|00000420| 47 61 6d 65 73 2c 20 49 | 6e 63 2e 20 20 41 6c 6c |Games, I|nc. All|
|00000430| 20 52 69 67 68 74 73 20 | 52 65 73 65 72 76 65 64 | Rights |Reserved|
|00000440| 0d 0a 2f 2f 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |..//====|========|
|00000450| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000460| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000470| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000480| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000490| 3d 3d 0d 0a 63 6c 61 73 | 73 20 55 6e 72 65 61 6c |==..clas|s Unreal|
|000004a0| 50 6c 61 79 65 72 43 68 | 61 74 4d 61 6e 61 67 65 |PlayerCh|atManage|
|000004b0| 72 20 65 78 74 65 6e 64 | 73 20 50 6c 61 79 65 72 |r extend|s Player|
|000004c0| 43 68 61 74 4d 61 6e 61 | 67 65 72 0d 0a 09 63 6f |ChatMana|ger...co|
|000004d0| 6e 66 69 67 28 43 68 61 | 74 52 65 73 74 72 69 63 |nfig(Cha|tRestric|
|000004e0| 74 69 6f 6e 29 3b 0d 0a | 0d 0a 63 6f 6e 73 74 20 |tion);..|..const |
|000004f0| 4e 4f 54 45 58 54 20 3d | 20 31 3b 0d 0a 63 6f 6e |NOTEXT =| 1;..con|
|00000500| 73 74 20 4e 4f 53 50 45 | 45 43 48 20 3d 20 32 3b |st NOSPE|ECH = 2;|
|00000510| 0d 0a 63 6f 6e 73 74 20 | 4e 4f 56 4f 49 43 45 20 |..const |NOVOICE |
|00000520| 3d 20 34 3b 0d 0a 63 6f | 6e 73 74 20 42 41 4e 4e |= 4;..co|nst BANN|
|00000530| 45 44 20 3d 20 38 3b 0d | 0a 0d 0a 73 74 72 75 63 |ED = 8;.|...struc|
|00000540| 74 20 53 74 6f 72 65 64 | 43 68 61 74 42 61 6e 0d |t Stored|ChatBan.|
|00000550| 0a 7b 0d 0a 09 76 61 72 | 20 73 74 72 69 6e 67 20 |.{...var| string |
|00000560| 50 6c 61 79 65 72 48 61 | 73 68 3b 0d 0a 09 76 61 |PlayerHa|sh;...va|
|00000570| 72 20 62 79 74 65 20 52 | 65 73 74 72 69 63 74 69 |r byte R|estricti|
|00000580| 6f 6e 3b 0d 0a 7d 3b 0d | 0a 0d 0a 73 74 72 75 63 |on;..};.|...struc|
|00000590| 74 20 43 68 61 74 42 61 | 6e 0d 0a 7b 0d 0a 09 76 |t ChatBa|n..{...v|
|000005a0| 61 72 20 69 6e 74 20 50 | 6c 61 79 65 72 49 44 3b |ar int P|layerID;|
|000005b0| 0d 0a 09 76 61 72 20 73 | 74 72 69 6e 67 20 50 6c |...var s|tring Pl|
|000005c0| 61 79 65 72 48 61 73 68 | 3b 0d 0a 09 76 61 72 20 |ayerHash|;...var |
|000005d0| 73 74 72 69 6e 67 20 50 | 6c 61 79 65 72 41 64 64 |string P|layerAdd|
|000005e0| 72 65 73 73 3b 0d 0a 09 | 76 61 72 20 62 79 74 65 |ress;...|var byte|
|000005f0| 20 50 6c 61 79 65 72 56 | 6f 69 63 65 4d 61 73 6b | PlayerV|oiceMask|
|00000600| 3b 0d 0a 09 76 61 72 20 | 62 79 74 65 20 52 65 73 |;...var |byte Res|
|00000610| 74 72 69 63 74 69 6f 6e | 3b 09 2f 2f 20 31 20 2d |triction|;.// 1 -|
|00000620| 20 54 65 78 74 2c 20 32 | 20 2d 20 53 70 65 65 63 | Text, 2| - Speec|
|00000630| 68 2c 20 34 20 2d 20 56 | 6f 69 63 65 2c 20 38 20 |h, 4 - V|oice, 8 |
|00000640| 2d 20 42 61 6e 6e 65 64 | 20 66 72 6f 6d 20 70 72 |- Banned| from pr|
|00000650| 69 76 61 74 65 20 63 68 | 61 74 0d 0a 7d 3b 0d 0a |ivate ch|at..};..|
|00000660| 0d 0a 2f 2f 20 52 65 73 | 74 72 69 63 74 65 64 20 |..// Res|tricted |
|00000670| 70 6c 61 79 65 72 20 68 | 61 73 68 65 73 2e 0d 0a |player h|ashes...|
|00000680| 76 61 72 20 67 6c 6f 62 | 61 6c 63 6f 6e 66 69 67 |var glob|alconfig|
|00000690| 20 70 72 6f 74 65 63 74 | 65 64 20 61 72 72 61 79 | protect|ed array|
|000006a0| 3c 53 74 6f 72 65 64 43 | 68 61 74 42 61 6e 3e 20 |<StoredC|hatBan> |
|000006b0| 53 74 6f 72 65 64 43 68 | 61 74 52 65 73 74 72 69 |StoredCh|atRestri|
|000006c0| 63 74 69 6f 6e 73 3b 0d | 0a 76 61 72 20 70 72 6f |ctions;.|.var pro|
|000006d0| 74 65 63 74 65 64 20 61 | 72 72 61 79 3c 43 68 61 |tected a|rray<Cha|
|000006e0| 74 42 61 6e 3e 09 09 09 | 09 09 43 68 61 74 52 65 |tBan>...|..ChatRe|
|000006f0| 73 74 72 69 63 74 69 6f | 6e 73 3b 0d 0a 0d 0a 0d |strictio|ns;.....|
|00000700| 0a 73 69 6d 75 6c 61 74 | 65 64 20 66 75 6e 63 74 |.simulat|ed funct|
|00000710| 69 6f 6e 20 43 68 61 74 | 44 65 62 75 67 28 29 0d |ion Chat|Debug().|
|00000720| 0a 7b 0d 0a 09 6c 6f 63 | 61 6c 20 69 6e 74 20 69 |.{...loc|al int i|
|00000730| 3b 0d 0a 0d 0a 09 66 6f | 72 20 28 20 69 20 3d 20 |;.....fo|r ( i = |
|00000740| 30 3b 20 69 20 3c 20 53 | 74 6f 72 65 64 43 68 61 |0; i < S|toredCha|
|00000750| 74 52 65 73 74 72 69 63 | 74 69 6f 6e 73 2e 4c 65 |tRestric|tions.Le|
|00000760| 6e 67 74 68 3b 20 69 2b | 2b 20 29 0d 0a 09 7b 0d |ngth; i+|+ )...{.|
|00000770| 0a 09 09 6c 6f 67 28 22 | 20 20 20 53 74 6f 72 65 |...log("| Store|
|00000780| 64 43 68 61 74 52 65 73 | 74 72 69 63 74 69 6f 6e |dChatRes|triction|
|00000790| 73 5b 22 24 69 24 22 5d | 20 48 61 73 68 3a 22 24 |s["$i$"]| Hash:"$|
|000007a0| 53 74 6f 72 65 64 43 68 | 61 74 52 65 73 74 72 69 |StoredCh|atRestri|
|000007b0| 63 74 69 6f 6e 73 5b 69 | 5d 2e 50 6c 61 79 65 72 |ctions[i|].Player|
|000007c0| 48 61 73 68 40 22 52 65 | 73 74 72 69 63 74 69 6f |Hash@"Re|strictio|
|000007d0| 6e 3a 22 24 53 74 6f 72 | 65 64 43 68 61 74 52 65 |n:"$Stor|edChatRe|
|000007e0| 73 74 72 69 63 74 69 6f | 6e 73 5b 69 5d 2e 52 65 |strictio|ns[i].Re|
|000007f0| 73 74 72 69 63 74 69 6f | 6e 29 3b 0d 0a 0d 0a 09 |strictio|n);.....|
|00000800| 7d 0d 0a 0d 0a 09 66 6f | 72 20 28 20 69 20 3d 20 |}.....fo|r ( i = |
|00000810| 30 3b 20 69 20 3c 20 43 | 68 61 74 52 65 73 74 72 |0; i < C|hatRestr|
|00000820| 69 63 74 69 6f 6e 73 2e | 4c 65 6e 67 74 68 3b 20 |ictions.|Length; |
|00000830| 69 2b 2b 20 29 0d 0a 09 | 7b 0d 0a 09 09 4c 6f 67 |i++ )...|{....Log|
|00000840| 43 68 61 74 52 65 73 74 | 72 69 63 74 69 6f 6e 28 |ChatRest|riction(|
|00000850| 69 29 3b 0d 0a 09 7d 0d | 0a 7d 0d 0a 0d 0a 73 69 |i);...}.|.}....si|
|00000860| 6d 75 6c 61 74 65 64 20 | 66 75 6e 63 74 69 6f 6e |mulated |function|
|00000870| 20 4c 6f 67 43 68 61 74 | 52 65 73 74 72 69 63 74 | LogChat|Restrict|
|00000880| 69 6f 6e 28 69 6e 74 20 | 69 29 0d 0a 7b 0d 0a 09 |ion(int |i)..{...|
|00000890| 6c 6f 67 28 22 20 20 20 | 43 68 61 74 52 65 73 74 |log(" |ChatRest|
|000008a0| 72 69 63 74 69 6f 6e 73 | 5b 22 24 69 24 22 5d 20 |rictions|["$i$"] |
|000008b0| 50 6c 61 79 65 72 49 44 | 3a 22 24 43 68 61 74 52 |PlayerID|:"$ChatR|
|000008c0| 65 73 74 72 69 63 74 69 | 6f 6e 73 5b 69 5d 2e 50 |estricti|ons[i].P|
|000008d0| 6c 61 79 65 72 49 44 40 | 0d 0a 09 09 09 22 48 61 |layerID@|....."Ha|
|000008e0| 73 68 3a 22 24 43 68 61 | 74 52 65 73 74 72 69 63 |sh:"$Cha|tRestric|
|000008f0| 74 69 6f 6e 73 5b 69 5d | 2e 50 6c 61 79 65 72 48 |tions[i]|.PlayerH|
|00000900| 61 73 68 40 0d 0a 09 09 | 09 22 41 64 64 72 65 73 |ash@....|."Addres|
|00000910| 73 3a 22 24 43 68 61 74 | 52 65 73 74 72 69 63 74 |s:"$Chat|Restrict|
|00000920| 69 6f 6e 73 5b 69 5d 2e | 50 6c 61 79 65 72 41 64 |ions[i].|PlayerAd|
|00000930| 64 72 65 73 73 40 0d 0a | 09 09 09 22 4d 61 73 6b |dress@..|..."Mask|
|00000940| 3a 22 24 43 68 61 74 52 | 65 73 74 72 69 63 74 69 |:"$ChatR|estricti|
|00000950| 6f 6e 73 5b 69 5d 2e 50 | 6c 61 79 65 72 56 6f 69 |ons[i].P|layerVoi|
|00000960| 63 65 4d 61 73 6b 40 0d | 0a 09 09 09 22 52 65 73 |ceMask@.|...."Res|
|00000970| 74 72 69 63 74 69 6f 6e | 3a 22 24 43 68 61 74 52 |triction|:"$ChatR|
|00000980| 65 73 74 72 69 63 74 69 | 6f 6e 73 5b 69 5d 2e 52 |estricti|ons[i].R|
|00000990| 65 73 74 72 69 63 74 69 | 6f 6e 29 3b 0d 0a 7d 0d |estricti|on);..}.|
|000009a0| 0a 0d 0a 2f 2f 20 43 61 | 6c 6c 65 64 20 66 72 6f |...// Ca|lled fro|
|000009b0| 6d 20 54 72 61 63 6b 4e | 65 77 50 6c 61 79 65 72 |m TrackN|ewPlayer|
|000009c0| 20 77 68 65 6e 20 77 65 | 20 72 65 63 65 69 76 65 | when we| receive|
|000009d0| 20 61 20 6e 65 77 20 70 | 6c 61 79 65 72 27 73 20 | a new p|layer's |
|000009e0| 69 6e 66 6f 72 6d 61 74 | 69 6f 6e 20 2d 20 63 68 |informat|ion - ch|
|000009f0| 65 63 6b 20 74 6f 20 73 | 65 65 20 69 66 20 77 65 |eck to s|ee if we|
|00000a00| 20 70 6c 61 63 65 64 20 | 61 20 72 65 73 74 72 69 | placed |a restri|
|00000a10| 63 74 69 6f 6e 20 6f 6e | 0d 0a 2f 2f 20 74 68 69 |ction on|..// thi|
|00000a20| 73 20 70 6c 61 79 65 72 | 20 64 75 72 69 6e 67 20 |s player| during |
|00000a30| 61 20 70 72 65 76 69 6f | 75 73 20 6d 61 74 63 68 |a previo|us match|
|00000a40| 0d 0a 73 69 6d 75 6c 61 | 74 65 64 20 70 72 6f 74 |..simula|ted prot|
|00000a50| 65 63 74 65 64 20 66 75 | 6e 63 74 69 6f 6e 20 62 |ected fu|nction b|
|00000a60| 6f 6f 6c 20 4c 6f 61 64 | 43 68 61 74 42 61 6e 28 |ool Load|ChatBan(|
|00000a70| 73 74 72 69 6e 67 20 50 | 6c 61 79 65 72 48 61 73 |string P|layerHas|
|00000a80| 68 2c 20 6f 75 74 20 62 | 79 74 65 20 4f 75 74 52 |h, out b|yte OutR|
|00000a90| 65 73 74 72 69 63 74 69 | 6f 6e 29 0d 0a 7b 0d 0a |estricti|on)..{..|
|00000aa0| 09 6c 6f 63 61 6c 20 69 | 6e 74 20 69 3b 0d 0a 0d |.local i|nt i;...|
|00000ab0| 0a 09 66 6f 72 20 28 20 | 69 20 3d 20 30 3b 20 69 |..for ( |i = 0; i|
|00000ac0| 20 3c 20 53 74 6f 72 65 | 64 43 68 61 74 52 65 73 | < Store|dChatRes|
|00000ad0| 74 72 69 63 74 69 6f 6e | 73 2e 4c 65 6e 67 74 68 |triction|s.Length|
|00000ae0| 3b 20 69 2b 2b 20 29 0d | 0a 09 7b 0d 0a 09 09 69 |; i++ ).|..{....i|
|00000af0| 66 20 28 20 53 74 6f 72 | 65 64 43 68 61 74 52 65 |f ( Stor|edChatRe|
|00000b00| 73 74 72 69 63 74 69 6f | 6e 73 5b 69 5d 2e 50 6c |strictio|ns[i].Pl|
|00000b10| 61 79 65 72 48 61 73 68 | 20 3d 3d 20 50 6c 61 79 |ayerHash| == Play|
|00000b20| 65 72 48 61 73 68 20 29 | 0d 0a 09 09 7b 0d 0a 09 |erHash )|....{...|
|00000b30| 09 09 4f 75 74 52 65 73 | 74 72 69 63 74 69 6f 6e |..OutRes|triction|
|00000b40| 20 3d 20 53 74 6f 72 65 | 64 43 68 61 74 52 65 73 | = Store|dChatRes|
|00000b50| 74 72 69 63 74 69 6f 6e | 73 5b 69 5d 2e 52 65 73 |triction|s[i].Res|
|00000b60| 74 72 69 63 74 69 6f 6e | 3b 0d 0a 09 09 09 72 65 |triction|;.....re|
|00000b70| 74 75 72 6e 20 74 72 75 | 65 3b 0d 0a 09 09 7d 0d |turn tru|e;....}.|
|00000b80| 0a 09 7d 0d 0a 0d 0a 09 | 72 65 74 75 72 6e 20 66 |..}.....|return f|
|00000b90| 61 6c 73 65 3b 0d 0a 7d | 0d 0a 0d 0a 2f 2f 20 53 |alse;..}|....// S|
|00000ba0| 61 76 65 20 74 68 65 20 | 50 6c 61 79 65 72 48 61 |ave the |PlayerHa|
|00000bb0| 73 68 20 61 6e 64 20 52 | 65 73 74 72 69 63 74 69 |sh and R|estricti|
|00000bc0| 6f 6e 20 74 6f 20 70 65 | 72 73 69 73 74 65 6e 74 |on to pe|rsistent|
|00000bd0| 20 61 72 72 61 79 0d 0a | 73 69 6d 75 6c 61 74 65 | array..|simulate|
|00000be0| 64 20 70 72 6f 74 65 63 | 74 65 64 20 66 75 6e 63 |d protec|ted func|
|00000bf0| 74 69 6f 6e 20 53 74 6f | 72 65 43 68 61 74 42 61 |tion Sto|reChatBa|
|00000c00| 6e 28 73 74 72 69 6e 67 | 20 50 6c 61 79 65 72 48 |n(string| PlayerH|
|00000c10| 61 73 68 2c 20 62 79 74 | 65 20 52 65 73 74 72 69 |ash, byt|e Restri|
|00000c20| 63 74 69 6f 6e 29 0d 0a | 7b 0d 0a 09 6c 6f 63 61 |ction)..|{...loca|
|00000c30| 6c 20 69 6e 74 20 69 3b | 0d 0a 0d 0a 09 2f 2f 20 |l int i;|.....// |
|00000c40| 46 69 72 73 74 2c 20 64 | 65 74 65 72 6d 69 6e 65 |First, d|etermine|
|00000c50| 20 69 66 20 74 68 69 73 | 20 70 6c 61 79 65 72 20 | if this| player |
|00000c60| 69 73 20 61 6c 72 65 61 | 64 79 20 69 6e 20 6f 75 |is alrea|dy in ou|
|00000c70| 72 20 6c 69 73 74 20 2d | 20 69 66 20 73 6f 2c 20 |r list -| if so, |
|00000c80| 72 65 70 6c 61 63 65 20 | 74 68 65 20 72 65 73 74 |replace |the rest|
|00000c90| 72 69 63 74 69 6f 6e 20 | 77 69 74 68 20 74 68 65 |riction |with the|
|00000ca0| 20 73 70 65 63 69 66 69 | 65 64 20 6f 6e 65 0d 0a | specifi|ed one..|
|00000cb0| 09 66 6f 72 20 28 20 69 | 20 3d 20 30 3b 20 69 20 |.for ( i| = 0; i |
|00000cc0| 3c 20 53 74 6f 72 65 64 | 43 68 61 74 52 65 73 74 |< Stored|ChatRest|
|00000cd0| 72 69 63 74 69 6f 6e 73 | 2e 4c 65 6e 67 74 68 3b |rictions|.Length;|
|00000ce0| 20 69 2b 2b 20 29 0d 0a | 09 7b 0d 0a 09 09 69 66 | i++ )..|.{....if|
|00000cf0| 20 28 20 53 74 6f 72 65 | 64 43 68 61 74 52 65 73 | ( Store|dChatRes|
|00000d00| 74 72 69 63 74 69 6f 6e | 73 5b 69 5d 2e 50 6c 61 |triction|s[i].Pla|
|00000d10| 79 65 72 48 61 73 68 20 | 3d 3d 20 50 6c 61 79 65 |yerHash |== Playe|
|00000d20| 72 48 61 73 68 20 29 0d | 0a 09 09 09 62 72 65 61 |rHash ).|....brea|
|00000d30| 6b 3b 0d 0a 09 7d 0d 0a | 0d 0a 09 69 66 20 28 20 |k;...}..|...if ( |
|00000d40| 69 20 3d 3d 20 53 74 6f | 72 65 64 43 68 61 74 52 |i == Sto|redChatR|
|00000d50| 65 73 74 72 69 63 74 69 | 6f 6e 73 2e 4c 65 6e 67 |estricti|ons.Leng|
|00000d60| 74 68 20 29 0d 0a 09 7b | 0d 0a 09 09 2f 2f 20 49 |th )...{|....// I|
|00000d70| 66 20 74 68 65 20 72 65 | 73 74 72 69 63 74 69 6f |f the re|strictio|
|00000d80| 6e 20 69 73 20 30 2c 20 | 73 74 6f 70 20 68 65 72 |n is 0, |stop her|
|00000d90| 65 20 2d 20 6e 6f 20 72 | 65 73 74 72 69 63 74 69 |e - no r|estricti|
|00000da0| 6f 6e 0d 0a 09 09 69 66 | 20 28 20 52 65 73 74 72 |on....if| ( Restr|
|00000db0| 69 63 74 69 6f 6e 20 3d | 3d 20 30 20 29 0d 0a 09 |iction =|= 0 )...|
|00000dc0| 09 09 72 65 74 75 72 6e | 3b 0d 0a 0d 0a 09 09 53 |..return|;......S|
|00000dd0| 74 6f 72 65 64 43 68 61 | 74 52 65 73 74 72 69 63 |toredCha|tRestric|
|00000de0| 74 69 6f 6e 73 2e 4c 65 | 6e 67 74 68 20 3d 20 69 |tions.Le|ngth = i|
|00000df0| 20 2b 20 31 3b 0d 0a 09 | 7d 0d 0a 09 65 6c 73 65 | + 1;...|}...else|
|00000e00| 20 69 66 20 28 20 52 65 | 73 74 72 69 63 74 69 6f | if ( Re|strictio|
|00000e10| 6e 20 3d 3d 20 30 20 29 | 0d 0a 09 7b 0d 0a 09 09 |n == 0 )|...{....|
|00000e20| 53 74 6f 72 65 64 43 68 | 61 74 52 65 73 74 72 69 |StoredCh|atRestri|
|00000e30| 63 74 69 6f 6e 73 2e 52 | 65 6d 6f 76 65 28 69 2c |ctions.R|emove(i,|
|00000e40| 31 29 3b 0d 0a 09 09 72 | 65 74 75 72 6e 3b 0d 0a |1);....r|eturn;..|
|00000e50| 09 7d 0d 0a 0d 0a 6c 6f | 67 28 22 53 74 6f 72 65 |.}....lo|g("Store|
|00000e60| 43 68 61 74 42 61 6e 20 | 50 6c 61 79 65 72 48 61 |ChatBan |PlayerHa|
|00000e70| 73 68 3a 22 24 50 6c 61 | 79 65 72 48 61 73 68 40 |sh:"$Pla|yerHash@|
|00000e80| 22 52 65 73 74 72 69 63 | 74 69 6f 6e 3a 22 24 52 |"Restric|tion:"$R|
|00000e90| 65 73 74 72 69 63 74 69 | 6f 6e 2c 27 43 68 61 74 |estricti|on,'Chat|
|00000ea0| 4d 61 6e 61 67 65 72 27 | 29 3b 0d 0a 09 53 74 6f |Manager'|);...Sto|
|00000eb0| 72 65 64 43 68 61 74 52 | 65 73 74 72 69 63 74 69 |redChatR|estricti|
|00000ec0| 6f 6e 73 5b 69 5d 2e 50 | 6c 61 79 65 72 48 61 73 |ons[i].P|layerHas|
|00000ed0| 68 20 3d 20 50 6c 61 79 | 65 72 48 61 73 68 3b 0d |h = Play|erHash;.|
|00000ee0| 0a 09 53 74 6f 72 65 64 | 43 68 61 74 52 65 73 74 |..Stored|ChatRest|
|00000ef0| 72 69 63 74 69 6f 6e 73 | 5b 69 5d 2e 52 65 73 74 |rictions|[i].Rest|
|00000f00| 72 69 63 74 69 6f 6e 20 | 3d 20 52 65 73 74 72 69 |riction |= Restri|
|00000f10| 63 74 69 6f 6e 3b 0d 0a | 7d 0d 0a 0d 0a 2f 2f 20 |ction;..|}....// |
|00000f20| 43 61 6c 6c 65 64 20 66 | 72 6f 6d 20 78 50 6c 61 |Called f|rom xPla|
|00000f30| 79 65 72 2e 53 65 72 76 | 65 72 52 65 71 75 65 73 |yer.Serv|erReques|
|00000f40| 74 42 61 6e 49 6e 66 6f | 20 2d 20 75 73 65 64 20 |tBanInfo| - used |
|00000f50| 74 6f 20 74 72 61 63 6b | 20 70 6c 61 79 65 72 20 |to track| player |
|00000f60| 68 61 73 68 65 73 20 6f | 6e 20 74 68 65 20 63 6c |hashes o|n the cl|
|00000f70| 69 65 6e 74 0d 0a 73 69 | 6d 75 6c 61 74 65 64 20 |ient..si|mulated |
|00000f80| 66 75 6e 63 74 69 6f 6e | 20 52 65 63 65 69 76 65 |function| Receive|
|00000f90| 42 61 6e 49 6e 66 6f 28 | 73 74 72 69 6e 67 20 53 |BanInfo(|string S|
|00000fa0| 29 0d 0a 7b 0d 0a 09 6c | 6f 63 61 6c 20 61 72 72 |)..{...l|ocal arr|
|00000fb0| 61 79 3c 73 74 72 69 6e | 67 3e 20 41 72 72 3b 0d |ay<strin|g> Arr;.|
|00000fc0| 0a 09 6c 6f 63 61 6c 20 | 69 6e 74 20 50 6c 61 79 |..local |int Play|
|00000fd0| 65 72 49 44 3b 0d 0a 09 | 6c 6f 63 61 6c 20 73 74 |erID;...|local st|
|00000fe0| 72 69 6e 67 20 50 6c 61 | 79 65 72 48 61 73 68 2c |ring Pla|yerHash,|
|00000ff0| 20 50 6c 61 79 65 72 41 | 64 64 72 65 73 73 3b 0d | PlayerA|ddress;.|
|00001000| 0a 0d 0a 09 6c 6f 67 28 | 4e 61 6d 65 40 22 52 65 |....log(|Name@"Re|
|00001010| 63 65 69 76 65 42 61 6e | 49 6e 66 6f 20 53 3a 22 |ceiveBan|Info S:"|
|00001020| 24 53 2c 27 43 68 61 74 | 4d 61 6e 61 67 65 72 27 |$S,'Chat|Manager'|
|00001030| 29 3b 0d 0a 09 53 70 6c | 69 74 28 53 2c 20 43 68 |);...Spl|it(S, Ch|
|00001040| 72 28 32 37 29 2c 20 41 | 72 72 29 3b 0d 0a 0d 0a |r(27), A|rr);....|
|00001050| 09 69 66 20 28 20 41 72 | 72 2e 4c 65 6e 67 74 68 |.if ( Ar|r.Length|
|00001060| 20 3c 20 33 20 29 0d 0a | 09 7b 0d 0a 09 09 6c 6f | < 3 )..|.{....lo|
|00001070| 67 28 22 45 72 72 6f 72 | 20 72 65 63 65 69 76 69 |g("Error| receivi|
|00001080| 6e 67 20 62 61 6e 20 69 | 6e 66 6f 20 41 72 72 2e |ng ban i|nfo Arr.|
|00001090| 4c 65 6e 67 74 68 3a 22 | 24 41 72 72 2e 4c 65 6e |Length:"|$Arr.Len|
|000010a0| 67 74 68 40 53 2c 27 43 | 68 61 74 4d 61 6e 61 67 |gth@S,'C|hatManag|
|000010b0| 65 72 27 29 3b 0d 0a 09 | 09 72 65 74 75 72 6e 3b |er');...|.return;|
|000010c0| 0d 0a 09 7d 0d 0a 0d 0a | 09 50 6c 61 79 65 72 49 |...}....|.PlayerI|
|000010d0| 44 20 3d 20 69 6e 74 28 | 41 72 72 5b 30 5d 29 3b |D = int(|Arr[0]);|
|000010e0| 0d 0a 09 50 6c 61 79 65 | 72 48 61 73 68 20 3d 20 |...Playe|rHash = |
|000010f0| 41 72 72 5b 31 5d 3b 0d | 0a 09 50 6c 61 79 65 72 |Arr[1];.|..Player|
|00001100| 41 64 64 72 65 73 73 20 | 3d 20 41 72 72 5b 32 5d |Address |= Arr[2]|
|00001110| 3b 0d 0a 0d 0a 09 54 72 | 61 63 6b 4e 65 77 50 6c |;.....Tr|ackNewPl|
|00001120| 61 79 65 72 28 50 6c 61 | 79 65 72 49 44 2c 20 50 |ayer(Pla|yerID, P|
|00001130| 6c 61 79 65 72 48 61 73 | 68 2c 20 50 6c 61 79 65 |layerHas|h, Playe|
|00001140| 72 41 64 64 72 65 73 73 | 29 3b 0d 0a 7d 0d 0a 0d |rAddress|);..}...|
|00001150| 0a 2f 2f 20 43 61 6c 6c | 65 64 20 77 68 65 6e 20 |.// Call|ed when |
|00001160| 77 65 27 76 65 20 72 65 | 63 65 69 76 65 64 20 61 |we've re|ceived a|
|00001170| 20 6e 65 77 20 70 6c 61 | 79 65 72 68 61 73 68 20 | new pla|yerhash |
|00001180| 66 72 6f 6d 20 52 65 63 | 65 69 76 65 42 61 6e 49 |from Rec|eiveBanI|
|00001190| 6e 66 6f 20 2d 0d 0a 73 | 69 6d 75 6c 61 74 65 64 |nfo -..s|imulated|
|000011a0| 20 66 75 6e 63 74 69 6f | 6e 20 54 72 61 63 6b 4e | functio|n TrackN|
|000011b0| 65 77 50 6c 61 79 65 72 | 28 69 6e 74 20 50 6c 61 |ewPlayer|(int Pla|
|000011c0| 79 65 72 49 44 2c 20 73 | 74 72 69 6e 67 20 50 6c |yerID, s|tring Pl|
|000011d0| 61 79 65 72 48 61 73 68 | 2c 20 73 74 72 69 6e 67 |ayerHash|, string|
|000011e0| 20 50 6c 61 79 65 72 41 | 64 64 72 65 73 73 29 0d | PlayerA|ddress).|
|000011f0| 0a 7b 0d 0a 09 6c 6f 63 | 61 6c 20 69 6e 74 20 69 |.{...loc|al int i|
|00001200| 3b 0d 0a 09 6c 6f 63 61 | 6c 20 50 6c 61 79 65 72 |;...loca|l Player|
|00001210| 52 65 70 6c 69 63 61 74 | 69 6f 6e 49 6e 66 6f 20 |Replicat|ionInfo |
|00001220| 50 52 49 3b 0d 0a 09 6c | 6f 63 61 6c 20 62 79 74 |PRI;...l|ocal byt|
|00001230| 65 20 4e 65 77 52 65 73 | 74 72 69 63 74 69 6f 6e |e NewRes|triction|
|00001240| 3b 0d 0a 0d 0a 09 69 66 | 20 28 20 50 6c 61 79 65 |;.....if| ( Playe|
|00001250| 72 4f 77 6e 65 72 20 3d | 3d 20 4e 6f 6e 65 20 29 |rOwner =|= None )|
|00001260| 0d 0a 09 7b 0d 0a 09 09 | 6c 6f 67 28 4e 61 6d 65 |...{....|log(Name|
|00001270| 40 22 43 6f 75 6c 64 6e | 27 74 20 75 70 64 61 74 |@"Couldn|'t updat|
|00001280| 65 20 73 65 72 76 65 72 | 20 74 72 61 63 6b 69 6e |e server| trackin|
|00001290| 67 20 2d 20 4e 6f 20 50 | 6c 61 79 65 72 4f 77 6e |g - No P|layerOwn|
|000012a0| 65 72 21 22 2c 27 43 68 | 61 74 4d 61 6e 61 67 65 |er!",'Ch|atManage|
|000012b0| 72 27 29 3b 0d 0a 09 09 | 72 65 74 75 72 6e 3b 0d |r');....|return;.|
|000012c0| 0a 09 7d 0d 0a 0d 0a 09 | 6c 6f 67 28 4e 61 6d 65 |..}.....|log(Name|
|000012d0| 40 22 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |@"______|________|
|000012e0| 5f 5f 5f 5f 5f 54 72 61 | 63 6b 4e 65 77 50 6c 61 |_____Tra|ckNewPla|
|000012f0| 79 65 72 20 50 6c 61 79 | 65 72 49 44 3a 22 24 50 |yer Play|erID:"$P|
|00001300| 6c 61 79 65 72 49 44 40 | 22 50 6c 61 79 65 72 48 |layerID@|"PlayerH|
|00001310| 61 73 68 3a 22 24 50 6c | 61 79 65 72 48 61 73 68 |ash:"$Pl|ayerHash|
|00001320| 40 22 50 6c 61 79 65 72 | 41 64 64 72 65 73 73 3a |@"Player|Address:|
|00001330| 22 24 50 6c 61 79 65 72 | 41 64 64 72 65 73 73 2c |"$Player|Address,|
|00001340| 27 43 68 61 74 4d 61 6e | 61 67 65 72 27 29 3b 0d |'ChatMan|ager');.|
|00001350| 0a 0d 0a 09 2f 2f 20 46 | 69 72 73 74 2c 20 63 68 |....// F|irst, ch|
|00001360| 65 63 6b 20 69 66 20 77 | 65 27 72 65 20 61 6c 72 |eck if w|e're alr|
|00001370| 65 61 64 79 20 74 72 61 | 63 6b 69 6e 67 20 74 68 |eady tra|cking th|
|00001380| 69 73 20 70 6c 61 79 65 | 72 0d 0a 09 66 6f 72 20 |is playe|r...for |
|00001390| 28 20 69 20 3d 20 30 3b | 20 69 20 3c 20 43 68 61 |( i = 0;| i < Cha|
|000013a0| 74 52 65 73 74 72 69 63 | 74 69 6f 6e 73 2e 4c 65 |tRestric|tions.Le|
|000013b0| 6e 67 74 68 3b 20 69 2b | 2b 20 29 0d 0a 09 09 69 |ngth; i+|+ )....i|
|000013c0| 66 20 28 20 43 68 61 74 | 52 65 73 74 72 69 63 74 |f ( Chat|Restrict|
|000013d0| 69 6f 6e 73 5b 69 5d 2e | 50 6c 61 79 65 72 49 44 |ions[i].|PlayerID|
|000013e0| 20 3d 3d 20 50 6c 61 79 | 65 72 49 44 20 29 0d 0a | == Play|erID )..|
|000013f0| 09 09 09 62 72 65 61 6b | 3b 0d 0a 0d 0a 09 69 66 |...break|;.....if|
|00001400| 20 28 20 69 20 3d 3d 20 | 43 68 61 74 52 65 73 74 | ( i == |ChatRest|
|00001410| 72 69 63 74 69 6f 6e 73 | 2e 4c 65 6e 67 74 68 20 |rictions|.Length |
|00001420| 29 0d 0a 09 09 43 68 61 | 74 52 65 73 74 72 69 63 |)....Cha|tRestric|
|00001430| 74 69 6f 6e 73 2e 4c 65 | 6e 67 74 68 20 3d 20 43 |tions.Le|ngth = C|
|00001440| 68 61 74 52 65 73 74 72 | 69 63 74 69 6f 6e 73 2e |hatRestr|ictions.|
|00001450| 4c 65 6e 67 74 68 20 2b | 20 31 3b 0d 0a 0d 0a 09 |Length +| 1;.....|
|00001460| 2f 2f 20 4e 65 78 74 2c | 20 63 68 65 63 6b 20 69 |// Next,| check i|
|00001470| 66 20 77 65 27 76 65 20 | 67 6f 74 20 74 68 69 73 |f we've |got this|
|00001480| 20 70 6c 61 79 65 72 27 | 73 20 68 61 73 68 20 69 | player'|s hash i|
|00001490| 6e 20 6f 75 72 20 6c 69 | 73 74 20 6f 66 20 73 74 |n our li|st of st|
|000014a0| 6f 72 65 64 20 62 61 6e | 73 2e 2e 2e 69 66 20 73 |ored ban|s...if s|
|000014b0| 6f 2c 20 6e 6f 74 69 66 | 79 20 74 68 65 20 73 65 |o, notif|y the se|
|000014c0| 72 76 65 72 20 61 62 6f | 75 74 20 6f 75 72 20 70 |rver abo|ut our p|
|000014d0| 72 65 66 65 72 65 6e 63 | 65 0d 0a 09 69 66 20 28 |referenc|e...if (|
|000014e0| 20 52 6f 6c 65 20 3c 20 | 52 4f 4c 45 5f 41 75 74 | Role < |ROLE_Aut|
|000014f0| 68 6f 72 69 74 79 20 26 | 26 20 4c 6f 61 64 43 68 |hority &|& LoadCh|
|00001500| 61 74 42 61 6e 28 50 6c | 61 79 65 72 48 61 73 68 |atBan(Pl|ayerHash|
|00001510| 2c 20 4e 65 77 52 65 73 | 74 72 69 63 74 69 6f 6e |, NewRes|triction|
|00001520| 29 20 29 0d 0a 09 09 50 | 6c 61 79 65 72 4f 77 6e |) )....P|layerOwn|
|00001530| 65 72 2e 53 65 72 76 65 | 72 43 68 61 74 52 65 73 |er.Serve|rChatRes|
|00001540| 74 72 69 63 74 69 6f 6e | 28 50 6c 61 79 65 72 49 |triction|(PlayerI|
|00001550| 44 2c 20 4e 65 77 52 65 | 73 74 72 69 63 74 69 6f |D, NewRe|strictio|
|00001560| 6e 29 3b 0d 0a 0d 0a 09 | 65 6c 73 65 20 69 66 20 |n);.....|else if |
|00001570| 28 20 4c 65 76 65 6c 2e | 4e 65 74 4d 6f 64 65 20 |( Level.|NetMode |
|00001580| 3d 3d 20 4e 4d 5f 4c 69 | 73 74 65 6e 53 65 72 76 |== NM_Li|stenServ|
|00001590| 65 72 20 26 26 20 50 6c | 61 79 65 72 4f 77 6e 65 |er && Pl|ayerOwne|
|000015a0| 72 20 3d 3d 20 4c 65 76 | 65 6c 2e 47 65 74 4c 6f |r == Lev|el.GetLo|
|000015b0| 63 61 6c 50 6c 61 79 65 | 72 43 6f 6e 74 72 6f 6c |calPlaye|rControl|
|000015c0| 6c 65 72 28 29 20 29 0d | 0a 09 09 4c 6f 61 64 43 |ler() ).|...LoadC|
|000015d0| 68 61 74 42 61 6e 28 50 | 6c 61 79 65 72 48 61 73 |hatBan(P|layerHas|
|000015e0| 68 2c 20 4e 65 77 52 65 | 73 74 72 69 63 74 69 6f |h, NewRe|strictio|
|000015f0| 6e 29 3b 0d 0a 0d 0a 09 | 2f 2f 20 4e 6f 77 2c 20 |n);.....|// Now, |
|00001600| 61 64 64 20 74 68 69 73 | 20 70 6c 61 79 65 72 20 |add this| player |
|00001610| 74 6f 20 74 68 65 20 69 | 6e 73 74 61 6e 63 65 20 |to the i|nstance |
|00001620| 74 72 61 63 6b 69 6e 67 | 0d 0a 09 43 68 61 74 52 |tracking|...ChatR|
|00001630| 65 73 74 72 69 63 74 69 | 6f 6e 73 5b 69 5d 2e 50 |estricti|ons[i].P|
|00001640| 6c 61 79 65 72 49 44 20 | 3d 20 50 6c 61 79 65 72 |layerID |= Player|
|00001650| 49 44 3b 0d 0a 09 43 68 | 61 74 52 65 73 74 72 69 |ID;...Ch|atRestri|
|00001660| 63 74 69 6f 6e 73 5b 69 | 5d 2e 50 6c 61 79 65 72 |ctions[i|].Player|
|00001670| 48 61 73 68 20 3d 20 50 | 6c 61 79 65 72 48 61 73 |Hash = P|layerHas|
|00001680| 68 3b 0d 0a 09 43 68 61 | 74 52 65 73 74 72 69 63 |h;...Cha|tRestric|
|00001690| 74 69 6f 6e 73 5b 69 5d | 2e 50 6c 61 79 65 72 41 |tions[i]|.PlayerA|
|000016a0| 64 64 72 65 73 73 20 3d | 20 50 6c 61 79 65 72 41 |ddress =| PlayerA|
|000016b0| 64 64 72 65 73 73 3b 0d | 0a 09 43 68 61 74 52 65 |ddress;.|..ChatRe|
|000016c0| 73 74 72 69 63 74 69 6f | 6e 73 5b 69 5d 2e 52 65 |strictio|ns[i].Re|
|000016d0| 73 74 72 69 63 74 69 6f | 6e 20 3d 20 4e 65 77 52 |strictio|n = NewR|
|000016e0| 65 73 74 72 69 63 74 69 | 6f 6e 3b 0d 0a 0d 0a 0d |estricti|on;.....|
|000016f0| 0a 09 2f 2f 20 46 69 6e | 61 6c 6c 79 2c 20 61 64 |..// Fin|ally, ad|
|00001700| 64 20 74 68 69 73 20 70 | 6c 61 79 65 72 27 73 20 |d this p|layer's |
|00001710| 76 6f 69 63 65 20 6d 61 | 73 6b 20 74 6f 20 74 68 |voice ma|sk to th|
|00001720| 65 20 74 72 61 63 6b 69 | 6e 67 20 69 6e 66 6f 20 |e tracki|ng info |
|00001730| 20 28 6f 6e 6c 79 20 68 | 61 70 70 65 6e 73 20 6f | (only h|appens o|
|00001740| 6e 20 73 65 72 76 65 72 | 29 2e 0d 0a 09 2f 2f 20 |n server|)....// |
|00001750| 56 6f 69 63 65 49 44 20 | 69 73 20 75 73 65 64 20 |VoiceID |is used |
|00001760| 74 6f 20 64 65 74 65 72 | 6d 69 6e 65 20 77 68 69 |to deter|mine whi|
|00001770| 63 68 20 70 6c 61 79 65 | 72 73 20 61 72 65 20 69 |ch playe|rs are i|
|00001780| 6e 20 77 68 69 63 68 20 | 63 68 61 6e 6e 65 6c 73 |n which |channels|
|00001790| 0d 0a 09 50 52 49 20 3d | 20 50 6c 61 79 65 72 4f |...PRI =| PlayerO|
|000017a0| 77 6e 65 72 2e 47 61 6d | 65 52 65 70 6c 69 63 61 |wner.Gam|eReplica|
|000017b0| 74 69 6f 6e 49 6e 66 6f | 2e 46 69 6e 64 50 6c 61 |tionInfo|.FindPla|
|000017c0| 79 65 72 42 79 49 44 28 | 50 6c 61 79 65 72 49 44 |yerByID(|PlayerID|
|000017d0| 29 3b 0d 0a 09 69 66 20 | 28 20 50 52 49 20 21 3d |);...if |( PRI !=|
|000017e0| 20 4e 6f 6e 65 20 29 0d | 0a 09 09 43 68 61 74 52 | None ).|...ChatR|
|000017f0| 65 73 74 72 69 63 74 69 | 6f 6e 73 5b 69 5d 2e 50 |estricti|ons[i].P|
|00001800| 6c 61 79 65 72 56 6f 69 | 63 65 4d 61 73 6b 20 3d |layerVoi|ceMask =|
|00001810| 20 50 52 49 2e 56 6f 69 | 63 65 49 44 3b 0d 0a 2f | PRI.Voi|ceID;../|
|00001820| 2f 09 65 6c 73 65 20 6c | 6f 67 28 4e 61 6d 65 40 |/.else l|og(Name@|
|00001830| 22 54 72 61 63 6b 4e 65 | 77 50 6c 61 79 65 72 20 |"TrackNe|wPlayer |
|00001840| 4e 6f 20 50 52 49 20 73 | 6f 20 63 6f 75 6c 64 6e |No PRI s|o couldn|
|00001850| 27 74 20 75 70 64 61 74 | 65 20 56 6f 69 63 65 49 |'t updat|e VoiceI|
|00001860| 44 20 66 6f 72 20 43 68 | 61 74 52 65 73 74 72 69 |D for Ch|atRestri|
|00001870| 63 74 69 6f 6e 73 5b 22 | 24 69 24 22 5d 22 2c 27 |ctions["|$i$"]",'|
|00001880| 43 68 61 74 4d 61 6e 61 | 67 65 72 27 29 3b 0d 0a |ChatMana|ger');..|
|00001890| 7d 0d 0a 0d 0a 73 69 6d | 75 6c 61 74 65 64 20 66 |}....sim|ulated f|
|000018a0| 75 6e 63 74 69 6f 6e 20 | 55 6e 54 72 61 63 6b 50 |unction |UnTrackP|
|000018b0| 6c 61 79 65 72 28 69 6e | 74 20 50 6c 61 79 65 72 |layer(in|t Player|
|000018c0| 49 44 29 0d 0a 7b 0d 0a | 09 6c 6f 63 61 6c 20 69 |ID)..{..|.local i|
|000018d0| 6e 74 20 69 3b 0d 0a 0d | 0a 09 6c 6f 67 28 22 55 |nt i;...|..log("U|
|000018e0| 6e 74 72 61 63 6b 20 70 | 6c 61 79 65 72 3a 22 24 |ntrack p|layer:"$|
|000018f0| 50 6c 61 79 65 72 49 44 | 2c 27 43 68 61 74 4d 61 |PlayerID|,'ChatMa|
|00001900| 6e 61 67 65 72 27 29 3b | 0d 0a 09 2f 2f 20 52 65 |nager');|...// Re|
|00001910| 6d 6f 76 65 20 74 68 69 | 73 20 70 6c 61 79 65 72 |move thi|s player|
|00001920| 20 66 72 6f 6d 20 74 68 | 65 20 62 61 6e 20 74 72 | from th|e ban tr|
|00001930| 61 63 6b 69 6e 67 20 73 | 79 73 74 65 6d 0d 0a 09 |acking s|ystem...|
|00001940| 66 6f 72 20 28 20 69 20 | 3d 20 30 3b 20 69 20 3c |for ( i |= 0; i <|
|00001950| 20 43 68 61 74 52 65 73 | 74 72 69 63 74 69 6f 6e | ChatRes|triction|
|00001960| 73 2e 4c 65 6e 67 74 68 | 3b 20 69 2b 2b 20 29 0d |s.Length|; i++ ).|
|00001970| 0a 09 7b 0d 0a 09 09 69 | 66 20 28 20 43 68 61 74 |..{....i|f ( Chat|
|00001980| 52 65 73 74 72 69 63 74 | 69 6f 6e 73 5b 69 5d 2e |Restrict|ions[i].|
|00001990| 50 6c 61 79 65 72 49 44 | 20 3d 3d 20 50 6c 61 79 |PlayerID| == Play|
|000019a0| 65 72 49 44 20 29 0d 0a | 09 09 7b 0d 0a 09 09 09 |erID )..|..{.....|
|000019b0| 43 68 61 74 52 65 73 74 | 72 69 63 74 69 6f 6e 73 |ChatRest|rictions|
|000019c0| 2e 52 65 6d 6f 76 65 28 | 69 2c 31 29 3b 0d 0a 09 |.Remove(|i,1);...|
|000019d0| 09 09 72 65 74 75 72 6e | 3b 0d 0a 09 09 7d 0d 0a |..return|;....}..|
|000019e0| 09 7d 0d 0a 0d 0a 09 6c | 6f 67 28 22 55 6e 74 72 |.}.....l|og("Untr|
|000019f0| 61 63 6b 20 70 6c 61 79 | 65 72 20 63 6f 75 6c 64 |ack play|er could|
|00001a00| 6e 27 74 20 66 69 6e 64 | 20 72 65 73 74 72 69 63 |n't find| restric|
|00001a10| 74 69 6f 6e 20 66 6f 72 | 20 50 6c 61 79 65 72 49 |tion for| PlayerI|
|00001a20| 44 3a 22 24 50 6c 61 79 | 65 72 49 44 2c 27 43 68 |D:"$Play|erID,'Ch|
|00001a30| 61 74 4d 61 6e 61 67 65 | 72 27 29 3b 0d 0a 7d 0d |atManage|r');..}.|
|00001a40| 0a 0d 0a 2f 2f 20 52 65 | 74 75 72 6e 73 20 77 68 |...// Re|turns wh|
|00001a50| 65 74 68 65 72 20 77 65 | 20 73 68 6f 75 6c 64 20 |ether we| should |
|00001a60| 72 65 63 65 69 76 65 20 | 74 65 78 74 20 6d 65 73 |receive |text mes|
|00001a70| 73 61 67 65 73 20 66 72 | 6f 6d 20 53 65 6e 64 65 |sages fr|om Sende|
|00001a80| 72 0d 0a 66 75 6e 63 74 | 69 6f 6e 20 62 6f 6f 6c |r..funct|ion bool|
|00001a90| 20 41 63 63 65 70 74 54 | 65 78 74 28 20 50 6c 61 | AcceptT|ext( Pla|
|00001aa0| 79 65 72 52 65 70 6c 69 | 63 61 74 69 6f 6e 49 6e |yerRepli|cationIn|
|00001ab0| 66 6f 20 53 65 6e 64 65 | 72 2c 20 6f 75 74 20 73 |fo Sende|r, out s|
|00001ac0| 74 72 69 6e 67 20 4d 73 | 67 2c 20 6f 70 74 69 6f |tring Ms|g, optio|
|00001ad0| 6e 61 6c 20 6e 61 6d 65 | 20 54 79 70 65 20 29 0d |nal name| Type ).|
|00001ae0| 0a 7b 0d 0a 09 6c 6f 63 | 61 6c 20 69 6e 74 20 69 |.{...loc|al int i|
|00001af0| 3b 0d 0a 0d 0a 09 69 66 | 20 28 20 53 65 6e 64 65 |;.....if| ( Sende|
|00001b00| 72 20 3d 3d 20 4e 6f 6e | 65 20 29 0d 0a 09 09 72 |r == Non|e )....r|
|00001b10| 65 74 75 72 6e 20 53 75 | 70 65 72 2e 41 63 63 65 |eturn Su|per.Acce|
|00001b20| 70 74 54 65 78 74 28 53 | 65 6e 64 65 72 2c 20 4d |ptText(S|ender, M|
|00001b30| 73 67 2c 20 54 79 70 65 | 29 3b 0d 0a 0d 0a 09 69 |sg, Type|);.....i|
|00001b40| 20 3d 20 47 65 74 49 44 | 49 6e 64 65 78 28 53 65 | = GetID|Index(Se|
|00001b50| 6e 64 65 72 2e 50 6c 61 | 79 65 72 49 44 29 3b 0d |nder.Pla|yerID);.|
|00001b60| 0a 09 69 66 20 28 20 21 | 49 73 56 61 6c 69 64 28 |..if ( !|IsValid(|
|00001b70| 69 29 20 29 0d 0a 09 09 | 72 65 74 75 72 6e 20 74 |i) )....|return t|
|00001b80| 72 75 65 3b 0d 0a 0d 0a | 09 6c 6f 67 28 4e 61 6d |rue;....|.log(Nam|
|00001b90| 65 40 22 4f 77 6e 65 72 | 3a 22 24 50 6c 61 79 65 |e@"Owner|:"$Playe|
|00001ba0| 72 4f 77 6e 65 72 2e 50 | 6c 61 79 65 72 52 65 70 |rOwner.P|layerRep|
|00001bb0| 6c 69 63 61 74 69 6f 6e | 49 6e 66 6f 2e 50 6c 61 |lication|Info.Pla|
|00001bc0| 79 65 72 4e 61 6d 65 40 | 22 52 65 73 74 72 69 63 |yerName@|"Restric|
|00001bd0| 74 69 6f 6e 20 66 6f 72 | 20 49 6e 64 65 78 20 22 |tion for| Index "|
|00001be0| 24 69 24 22 3a 22 24 43 | 68 61 74 52 65 73 74 72 |$i$":"$C|hatRestr|
|00001bf0| 69 63 74 69 6f 6e 73 5b | 69 5d 2e 52 65 73 74 72 |ictions[|i].Restr|
|00001c00| 69 63 74 69 6f 6e 2c 27 | 43 68 61 74 4d 61 6e 61 |iction,'|ChatMana|
|00001c10| 67 65 72 27 29 3b 0d 0a | 09 72 65 74 75 72 6e 20 |ger');..|.return |
|00001c20| 21 62 6f 6f 6c 28 43 68 | 61 74 52 65 73 74 72 69 |!bool(Ch|atRestri|
|00001c30| 63 74 69 6f 6e 73 5b 69 | 5d 2e 52 65 73 74 72 69 |ctions[i|].Restri|
|00001c40| 63 74 69 6f 6e 20 26 20 | 4e 4f 54 45 58 54 29 3b |ction & |NOTEXT);|
|00001c50| 0d 0a 7d 0d 0a 0d 0a 2f | 2f 20 52 65 74 75 72 6e |..}..../|/ Return|
|00001c60| 73 20 77 68 65 74 68 65 | 72 20 77 65 20 73 68 6f |s whethe|r we sho|
|00001c70| 75 6c 64 20 72 65 63 65 | 69 76 65 20 53 70 65 65 |uld rece|ive Spee|
|00001c80| 63 68 20 6d 65 73 73 61 | 67 65 73 20 66 72 6f 6d |ch messa|ges from|
|00001c90| 20 53 65 6e 64 65 72 0d | 0a 66 75 6e 63 74 69 6f | Sender.|.functio|
|00001ca0| 6e 20 62 6f 6f 6c 20 41 | 63 63 65 70 74 53 70 65 |n bool A|cceptSpe|
|00001cb0| 65 63 68 28 50 6c 61 79 | 65 72 52 65 70 6c 69 63 |ech(Play|erReplic|
|00001cc0| 61 74 69 6f 6e 49 6e 66 | 6f 20 53 65 6e 64 65 72 |ationInf|o Sender|
|00001cd0| 50 52 49 29 0d 0a 7b 0d | 0a 09 6c 6f 63 61 6c 20 |PRI)..{.|..local |
|00001ce0| 69 6e 74 20 69 3b 0d 0a | 0d 0a 09 69 66 20 28 20 |int i;..|...if ( |
|00001cf0| 53 65 6e 64 65 72 50 52 | 49 20 3d 3d 20 4e 6f 6e |SenderPR|I == Non|
|00001d00| 65 20 29 0d 0a 09 09 72 | 65 74 75 72 6e 20 53 75 |e )....r|eturn Su|
|00001d10| 70 65 72 2e 41 63 63 65 | 70 74 53 70 65 65 63 68 |per.Acce|ptSpeech|
|00001d20| 28 53 65 6e 64 65 72 50 | 52 49 29 3b 0d 0a 0d 0a |(SenderP|RI);....|
|00001d30| 09 69 20 3d 20 47 65 74 | 49 44 49 6e 64 65 78 28 |.i = Get|IDIndex(|
|00001d40| 53 65 6e 64 65 72 50 52 | 49 2e 50 6c 61 79 65 72 |SenderPR|I.Player|
|00001d50| 49 44 29 3b 0d 0a 09 69 | 66 20 28 20 21 49 73 56 |ID);...i|f ( !IsV|
|00001d60| 61 6c 69 64 28 69 29 20 | 29 0d 0a 09 09 72 65 74 |alid(i) |)....ret|
|00001d70| 75 72 6e 20 74 72 75 65 | 3b 0d 0a 0d 0a 09 72 65 |urn true|;.....re|
|00001d80| 74 75 72 6e 20 21 62 6f | 6f 6c 28 43 68 61 74 52 |turn !bo|ol(ChatR|
|00001d90| 65 73 74 72 69 63 74 69 | 6f 6e 73 5b 69 5d 2e 52 |estricti|ons[i].R|
|00001da0| 65 73 74 72 69 63 74 69 | 6f 6e 20 26 20 4e 4f 53 |estricti|on & NOS|
|00001db0| 50 45 45 43 48 29 3b 0d | 0a 7d 0d 0a 0d 0a 2f 2f |PEECH);.|.}....//|
|00001dc0| 20 52 65 74 75 72 6e 73 | 20 77 68 65 74 68 65 72 | Returns| whether|
|00001dd0| 20 77 65 20 73 68 6f 75 | 6c 64 20 61 63 63 65 70 | we shou|ld accep|
|00001de0| 74 20 76 6f 69 63 65 20 | 6d 65 73 73 61 67 65 73 |t voice |messages|
|00001df0| 20 66 72 6f 6d 20 73 65 | 6e 64 65 72 0d 0a 65 76 | from se|nder..ev|
|00001e00| 65 6e 74 20 62 6f 6f 6c | 20 41 63 63 65 70 74 56 |ent bool| AcceptV|
|00001e10| 6f 69 63 65 28 50 6c 61 | 79 65 72 52 65 70 6c 69 |oice(Pla|yerRepli|
|00001e20| 63 61 74 69 6f 6e 49 6e | 66 6f 20 53 65 6e 64 65 |cationIn|fo Sende|
|00001e30| 72 50 52 49 29 0d 0a 7b | 0d 0a 09 6c 6f 63 61 6c |rPRI)..{|...local|
|00001e40| 20 69 6e 74 20 69 3b 0d | 0a 0d 0a 09 69 66 20 28 | int i;.|....if (|
|00001e50| 20 53 65 6e 64 65 72 50 | 52 49 20 3d 3d 20 4e 6f | SenderP|RI == No|
|00001e60| 6e 65 20 29 0d 0a 09 09 | 72 65 74 75 72 6e 20 53 |ne )....|return S|
|00001e70| 75 70 65 72 2e 41 63 63 | 65 70 74 56 6f 69 63 65 |uper.Acc|eptVoice|
|00001e80| 28 53 65 6e 64 65 72 50 | 52 49 29 3b 0d 0a 0d 0a |(SenderP|RI);....|
|00001e90| 09 69 20 3d 20 47 65 74 | 49 44 49 6e 64 65 78 28 |.i = Get|IDIndex(|
|00001ea0| 53 65 6e 64 65 72 50 52 | 49 2e 50 6c 61 79 65 72 |SenderPR|I.Player|
|00001eb0| 49 44 29 3b 0d 0a 09 69 | 66 20 28 20 21 49 73 56 |ID);...i|f ( !IsV|
|00001ec0| 61 6c 69 64 28 69 29 20 | 29 0d 0a 09 09 72 65 74 |alid(i) |)....ret|
|00001ed0| 75 72 6e 20 74 72 75 65 | 3b 0d 0a 0d 0a 09 72 65 |urn true|;.....re|
|00001ee0| 74 75 72 6e 20 21 62 6f | 6f 6c 28 43 68 61 74 52 |turn !bo|ol(ChatR|
|00001ef0| 65 73 74 72 69 63 74 69 | 6f 6e 73 5b 69 5d 2e 52 |estricti|ons[i].R|
|00001f00| 65 73 74 72 69 63 74 69 | 6f 6e 20 26 20 4e 4f 56 |estricti|on & NOV|
|00001f10| 4f 49 43 45 29 3b 0d 0a | 7d 0d 0a 0d 0a 66 75 6e |OICE);..|}....fun|
|00001f20| 63 74 69 6f 6e 20 62 6f | 6f 6c 20 49 73 42 61 6e |ction bo|ol IsBan|
|00001f30| 6e 65 64 28 50 6c 61 79 | 65 72 52 65 70 6c 69 63 |ned(Play|erReplic|
|00001f40| 61 74 69 6f 6e 49 6e 66 | 6f 20 50 52 49 29 0d 0a |ationInf|o PRI)..|
|00001f50| 7b 0d 0a 09 6c 6f 63 61 | 6c 20 69 6e 74 20 69 3b |{...loca|l int i;|
|00001f60| 0d 0a 09 6c 6f 63 61 6c | 20 73 74 72 69 6e 67 20 |...local| string |
|00001f70| 50 6c 61 79 65 72 48 61 | 73 68 3b 0d 0a 0d 0a 09 |PlayerHa|sh;.....|
|00001f80| 50 6c 61 79 65 72 48 61 | 73 68 20 3d 20 50 6c 61 |PlayerHa|sh = Pla|
|00001f90| 79 65 72 43 6f 6e 74 72 | 6f 6c 6c 65 72 28 50 52 |yerContr|oller(PR|
|00001fa0| 49 2e 4f 77 6e 65 72 29 | 2e 47 65 74 50 6c 61 79 |I.Owner)|.GetPlay|
|00001fb0| 65 72 49 44 48 61 73 68 | 28 29 3b 0d 0a 09 6c 6f |erIDHash|();...lo|
|00001fc0| 67 28 4e 61 6d 65 40 22 | 49 73 42 61 6e 6e 65 64 |g(Name@"|IsBanned|
|00001fd0| 28 29 20 50 52 49 3a 22 | 24 50 52 49 2e 4e 61 6d |() PRI:"|$PRI.Nam|
|00001fe0| 65 2c 27 43 68 61 74 4d | 61 6e 61 67 65 72 27 29 |e,'ChatM|anager')|
|00001ff0| 3b 0d 0a 09 66 6f 72 20 | 28 69 20 3d 20 30 3b 20 |;...for |(i = 0; |
|00002000| 69 20 3c 20 43 68 61 74 | 52 65 73 74 72 69 63 74 |i < Chat|Restrict|
|00002010| 69 6f 6e 73 2e 4c 65 6e | 67 74 68 3b 20 69 2b 2b |ions.Len|gth; i++|
|00002020| 29 0d 0a 09 7b 0d 0a 09 | 09 69 66 20 28 43 68 61 |)...{...|.if (Cha|
|00002030| 74 52 65 73 74 72 69 63 | 74 69 6f 6e 73 5b 69 5d |tRestric|tions[i]|
|00002040| 2e 50 6c 61 79 65 72 48 | 61 73 68 20 3d 3d 20 50 |.PlayerH|ash == P|
|00002050| 6c 61 79 65 72 48 61 73 | 68 29 0d 0a 09 09 7b 0d |layerHas|h)....{.|
|00002060| 0a 09 09 09 6c 6f 67 28 | 4e 61 6d 65 40 22 49 73 |....log(|Name@"Is|
|00002070| 42 61 6e 6e 65 64 28 29 | 20 66 6f 75 6e 64 20 6d |Banned()| found m|
|00002080| 61 74 63 68 69 6e 67 20 | 50 6c 61 79 65 72 48 61 |atching |PlayerHa|
|00002090| 73 68 20 66 6f 72 22 40 | 50 6c 61 79 65 72 48 61 |sh for"@|PlayerHa|
|000020a0| 73 68 24 22 3a 22 24 69 | 40 22 52 65 73 74 72 69 |sh$":"$i|@"Restri|
|000020b0| 63 74 69 6f 6e 3a 22 24 | 43 68 61 74 52 65 73 74 |ction:"$|ChatRest|
|000020c0| 72 69 63 74 69 6f 6e 73 | 5b 69 5d 2e 52 65 73 74 |rictions|[i].Rest|
|000020d0| 72 69 63 74 69 6f 6e 2c | 27 43 68 61 74 4d 61 6e |riction,|'ChatMan|
|000020e0| 61 67 65 72 27 29 3b 0d | 0a 09 09 09 72 65 74 75 |ager');.|....retu|
|000020f0| 72 6e 20 62 6f 6f 6c 28 | 43 68 61 74 52 65 73 74 |rn bool(|ChatRest|
|00002100| 72 69 63 74 69 6f 6e 73 | 5b 69 5d 2e 52 65 73 74 |rictions|[i].Rest|
|00002110| 72 69 63 74 69 6f 6e 20 | 26 20 42 41 4e 4e 45 44 |riction |& BANNED|
|00002120| 29 3b 0d 0a 09 09 7d 0d | 0a 09 7d 0d 0a 0d 0a 09 |);....}.|..}.....|
|00002130| 72 65 74 75 72 6e 20 53 | 75 70 65 72 2e 49 73 42 |return S|uper.IsB|
|00002140| 61 6e 6e 65 64 28 50 52 | 49 29 3b 0d 0a 7d 0d 0a |anned(PR|I);..}..|
|00002150| 0d 0a 2f 2f 20 55 70 64 | 61 74 65 20 74 68 65 20 |..// Upd|ate the |
|00002160| 72 65 73 74 72 69 63 74 | 69 6f 6e 73 20 6f 6e 20 |restrict|ions on |
|00002170| 63 68 61 74 20 66 6f 72 | 20 61 20 70 6c 61 79 65 |chat for| a playe|
|00002180| 72 0d 0a 73 69 6d 75 6c | 61 74 65 64 20 66 75 6e |r..simul|ated fun|
|00002190| 63 74 69 6f 6e 20 62 6f | 6f 6c 20 53 65 74 52 65 |ction bo|ol SetRe|
|000021a0| 73 74 72 69 63 74 69 6f | 6e 28 73 74 72 69 6e 67 |strictio|n(string|
|000021b0| 20 50 6c 61 79 65 72 48 | 61 73 68 2c 20 62 79 74 | PlayerH|ash, byt|
|000021c0| 65 20 54 79 70 65 29 0d | 0a 7b 0d 0a 09 6c 6f 63 |e Type).|.{...loc|
|000021d0| 61 6c 20 69 6e 74 20 69 | 3b 0d 0a 0d 0a 09 69 20 |al int i|;.....i |
|000021e0| 3d 20 47 65 74 48 61 73 | 68 49 6e 64 65 78 28 50 |= GetHas|hIndex(P|
|000021f0| 6c 61 79 65 72 48 61 73 | 68 29 3b 0d 0a 0d 0a 6c |layerHas|h);....l|
|00002200| 6f 67 28 4e 61 6d 65 40 | 22 53 65 74 52 65 73 74 |og(Name@|"SetRest|
|00002210| 72 69 63 74 69 6f 6e 20 | 50 6c 61 79 65 72 48 61 |riction |PlayerHa|
|00002220| 73 68 3a 22 24 50 6c 61 | 79 65 72 48 61 73 68 40 |sh:"$Pla|yerHash@|
|00002230| 22 69 3a 22 24 69 40 22 | 54 79 70 65 3a 22 24 54 |"i:"$i@"|Type:"$T|
|00002240| 79 70 65 2c 27 43 68 61 | 74 4d 61 6e 61 67 65 72 |ype,'Cha|tManager|
|00002250| 27 29 3b 0d 0a 09 69 66 | 20 28 20 21 49 73 56 61 |');...if| ( !IsVa|
|00002260| 6c 69 64 28 69 29 20 29 | 0d 0a 09 7b 0d 0a 09 09 |lid(i) )|...{....|
|00002270| 2f 2f 20 49 66 20 77 65 | 20 61 72 65 6e 27 74 20 |// If we| aren't |
|00002280| 63 75 72 72 65 6e 74 6c | 79 20 74 72 61 63 6b 69 |currentl|y tracki|
|00002290| 6e 67 20 74 68 69 73 20 | 70 6c 61 79 65 72 2c 20 |ng this |player, |
|000022a0| 61 6e 64 20 74 68 65 20 | 72 65 73 74 72 69 63 74 |and the |restrict|
|000022b0| 69 6f 6e 20 69 73 20 6e | 6f 6e 65 2c 20 64 6f 6e |ion is n|one, don|
|000022c0| 27 74 20 61 64 64 20 74 | 68 65 20 72 65 73 74 72 |'t add t|he restr|
|000022d0| 69 63 74 69 6f 6e 0d 0a | 09 09 69 66 20 28 20 54 |iction..|..if ( T|
|000022e0| 79 70 65 20 3d 3d 20 30 | 20 29 0d 0a 09 09 09 72 |ype == 0| ).....r|
|000022f0| 65 74 75 72 6e 20 66 61 | 6c 73 65 3b 0d 0a 0d 0a |eturn fa|lse;....|
|00002300| 09 09 69 20 3d 20 43 68 | 61 74 52 65 73 74 72 69 |..i = Ch|atRestri|
|00002310| 63 74 69 6f 6e 73 2e 4c | 65 6e 67 74 68 3b 0d 0a |ctions.L|ength;..|
|00002320| 09 09 43 68 61 74 52 65 | 73 74 72 69 63 74 69 6f |..ChatRe|strictio|
|00002330| 6e 73 2e 4c 65 6e 67 74 | 68 20 3d 20 69 20 2b 20 |ns.Lengt|h = i + |
|00002340| 31 3b 0d 0a 09 7d 0d 0a | 0d 0a 09 2f 2f 20 49 66 |1;...}..|...// If|
|00002350| 20 74 68 65 20 6e 65 77 | 20 72 65 73 74 72 69 63 | the new| restric|
|00002360| 74 69 6f 6e 20 69 73 20 | 74 68 65 20 73 61 6d 65 |tion is |the same|
|00002370| 20 61 73 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 | as the |current |
|00002380| 72 65 73 74 72 69 63 74 | 69 6f 6e 2c 20 73 74 6f |restrict|ion, sto|
|00002390| 70 20 68 65 72 65 0d 0a | 09 65 6c 73 65 20 69 66 |p here..|.else if|
|000023a0| 20 28 20 43 68 61 74 52 | 65 73 74 72 69 63 74 69 | ( ChatR|estricti|
|000023b0| 6f 6e 73 5b 69 5d 2e 52 | 65 73 74 72 69 63 74 69 |ons[i].R|estricti|
|000023c0| 6f 6e 20 3d 3d 20 54 79 | 70 65 20 29 0d 0a 09 09 |on == Ty|pe )....|
|000023d0| 72 65 74 75 72 6e 20 66 | 61 6c 73 65 3b 0d 0a 0d |return f|alse;...|
|000023e0| 0a 09 43 68 61 74 52 65 | 73 74 72 69 63 74 69 6f |..ChatRe|strictio|
|000023f0| 6e 73 5b 69 5d 2e 52 65 | 73 74 72 69 63 74 69 6f |ns[i].Re|strictio|
|00002400| 6e 20 3d 20 54 79 70 65 | 3b 0d 0a 0d 0a 09 2f 2f |n = Type|;.....//|
|00002410| 20 49 66 20 77 65 27 72 | 65 20 74 68 65 20 63 6c | If we'r|e the cl|
|00002420| 69 65 6e 74 2c 20 63 6f | 70 79 20 74 68 65 20 72 |ient, co|py the r|
|00002430| 65 73 74 72 69 63 74 69 | 6f 6e 20 74 6f 20 74 68 |estricti|on to th|
|00002440| 65 20 70 65 72 73 69 73 | 74 65 6e 74 20 61 72 72 |e persis|tent arr|
|00002450| 61 79 0d 0a 09 69 66 20 | 28 20 49 73 4c 6f 63 61 |ay...if |( IsLoca|
|00002460| 6c 28 29 20 29 0d 0a 09 | 7b 0d 0a 09 09 53 74 6f |l() )...|{....Sto|
|00002470| 72 65 43 68 61 74 42 61 | 6e 28 50 6c 61 79 65 72 |reChatBa|n(Player|
|00002480| 48 61 73 68 2c 20 54 79 | 70 65 29 3b 0d 0a 09 09 |Hash, Ty|pe);....|
|00002490| 53 61 76 65 43 6f 6e 66 | 69 67 28 29 3b 0d 0a 09 |SaveConf|ig();...|
|000024a0| 7d 0d 0a 09 72 65 74 75 | 72 6e 20 74 72 75 65 3b |}...retu|rn true;|
|000024b0| 0d 0a 7d 0d 0a 0d 0a 73 | 69 6d 75 6c 61 74 65 64 |..}....s|imulated|
|000024c0| 20 66 75 6e 63 74 69 6f | 6e 20 62 6f 6f 6c 20 53 | functio|n bool S|
|000024d0| 65 74 52 65 73 74 72 69 | 63 74 69 6f 6e 49 44 28 |etRestri|ctionID(|
|000024e0| 69 6e 74 20 50 6c 61 79 | 65 72 49 44 2c 20 62 79 |int Play|erID, by|
|000024f0| 74 65 20 54 79 70 65 29 | 0d 0a 7b 0d 0a 09 6c 6f |te Type)|..{...lo|
|00002500| 63 61 6c 20 73 74 72 69 | 6e 67 20 50 6c 61 79 65 |cal stri|ng Playe|
|00002510| 72 48 61 73 68 3b 0d 0a | 0d 0a 09 6c 6f 67 28 4e |rHash;..|...log(N|
|00002520| 61 6d 65 40 22 53 65 74 | 52 65 73 74 72 69 63 74 |ame@"Set|Restrict|
|00002530| 69 6f 6e 49 44 20 50 6c | 61 79 65 72 49 44 3a 22 |ionID Pl|ayerID:"|
|00002540| 24 50 6c 61 79 65 72 49 | 44 40 22 54 79 70 65 3a |$PlayerI|D@"Type:|
|00002550| 22 24 54 79 70 65 2c 27 | 43 68 61 74 4d 61 6e 61 |"$Type,'|ChatMana|
|00002560| 67 65 72 27 29 3b 0d 0a | 0d 0a 09 2f 2f 20 51 75 |ger');..|...// Qu|
|00002570| 65 72 79 20 74 68 65 20 | 70 6c 61 79 65 72 27 73 |ery the |player's|
|00002580| 20 68 61 73 68 20 66 72 | 6f 6d 20 74 68 65 20 74 | hash fr|om the t|
|00002590| 72 61 63 6b 69 6e 67 20 | 73 79 73 74 65 6d 0d 0a |racking |system..|
|000025a0| 09 50 6c 61 79 65 72 48 | 61 73 68 20 3d 20 47 65 |.PlayerH|ash = Ge|
|000025b0| 74 50 6c 61 79 65 72 48 | 61 73 68 28 50 6c 61 79 |tPlayerH|ash(Play|
|000025c0| 65 72 49 44 29 3b 0d 0a | 09 69 66 20 28 20 50 6c |erID);..|.if ( Pl|
|000025d0| 61 79 65 72 48 61 73 68 | 20 3d 3d 20 22 22 20 29 |ayerHash| == "" )|
|000025e0| 0d 0a 09 09 72 65 74 75 | 72 6e 20 66 61 6c 73 65 |....retu|rn false|
|000025f0| 3b 0d 0a 0d 0a 09 72 65 | 74 75 72 6e 20 53 65 74 |;.....re|turn Set|
|00002600| 52 65 73 74 72 69 63 74 | 69 6f 6e 28 50 6c 61 79 |Restrict|ion(Play|
|00002610| 65 72 48 61 73 68 2c 20 | 54 79 70 65 29 3b 0d 0a |erHash, |Type);..|
|00002620| 7d 0d 0a 0d 0a 73 69 6d | 75 6c 61 74 65 64 20 66 |}....sim|ulated f|
|00002630| 75 6e 63 74 69 6f 6e 20 | 62 6f 6f 6c 20 41 64 64 |unction |bool Add|
|00002640| 52 65 73 74 72 69 63 74 | 69 6f 6e 28 20 73 74 72 |Restrict|ion( str|
|00002650| 69 6e 67 20 50 6c 61 79 | 65 72 48 61 73 68 2c 20 |ing Play|erHash, |
|00002660| 62 79 74 65 20 54 79 70 | 65 20 29 0d 0a 7b 0d 0a |byte Typ|e )..{..|
|00002670| 09 72 65 74 75 72 6e 20 | 4d 65 72 67 65 52 65 73 |.return |MergeRes|
|00002680| 74 72 69 63 74 69 6f 6e | 28 20 47 65 74 48 61 73 |triction|( GetHas|
|00002690| 68 49 6e 64 65 78 28 50 | 6c 61 79 65 72 48 61 73 |hIndex(P|layerHas|
|000026a0| 68 29 2c 20 54 79 70 65 | 20 29 3b 0d 0a 7d 0d 0a |h), Type| );..}..|
|000026b0| 0d 0a 73 69 6d 75 6c 61 | 74 65 64 20 66 75 6e 63 |..simula|ted func|
|000026c0| 74 69 6f 6e 20 62 6f 6f | 6c 20 41 64 64 52 65 73 |tion boo|l AddRes|
|000026d0| 74 72 69 63 74 69 6f 6e | 49 44 28 20 69 6e 74 20 |triction|ID( int |
|000026e0| 50 6c 61 79 65 72 49 44 | 2c 20 62 79 74 65 20 54 |PlayerID|, byte T|
|000026f0| 79 70 65 20 29 0d 0a 7b | 0d 0a 09 72 65 74 75 72 |ype )..{|...retur|
|00002700| 6e 20 41 64 64 52 65 73 | 74 72 69 63 74 69 6f 6e |n AddRes|triction|
|00002710| 28 47 65 74 50 6c 61 79 | 65 72 48 61 73 68 28 50 |(GetPlay|erHash(P|
|00002720| 6c 61 79 65 72 49 44 29 | 2c 20 54 79 70 65 29 3b |layerID)|, Type);|
|00002730| 0d 0a 7d 0d 0a 0d 0a 73 | 69 6d 75 6c 61 74 65 64 |..}....s|imulated|
|00002740| 20 66 75 6e 63 74 69 6f | 6e 20 62 6f 6f 6c 20 43 | functio|n bool C|
|00002750| 6c 65 61 72 52 65 73 74 | 72 69 63 74 69 6f 6e 28 |learRest|riction(|
|00002760| 20 73 74 72 69 6e 67 20 | 50 6c 61 79 65 72 48 61 | string |PlayerHa|
|00002770| 73 68 2c 20 62 79 74 65 | 20 54 79 70 65 20 29 0d |sh, byte| Type ).|
|00002780| 0a 7b 0d 0a 09 72 65 74 | 75 72 6e 20 55 6e 4d 65 |.{...ret|urn UnMe|
|00002790| 72 67 65 52 65 73 74 72 | 69 63 74 69 6f 6e 28 20 |rgeRestr|iction( |
|000027a0| 47 65 74 48 61 73 68 49 | 6e 64 65 78 28 50 6c 61 |GetHashI|ndex(Pla|
|000027b0| 79 65 72 48 61 73 68 29 | 2c 20 54 79 70 65 29 3b |yerHash)|, Type);|
|000027c0| 0d 0a 7d 0d 0a 0d 0a 73 | 69 6d 75 6c 61 74 65 64 |..}....s|imulated|
|000027d0| 20 66 75 6e 63 74 69 6f | 6e 20 62 6f 6f 6c 20 43 | functio|n bool C|
|000027e0| 6c 65 61 72 52 65 73 74 | 72 69 63 74 69 6f 6e 49 |learRest|rictionI|
|000027f0| 44 28 20 69 6e 74 20 50 | 6c 61 79 65 72 49 44 2c |D( int P|layerID,|
|00002800| 20 62 79 74 65 20 54 79 | 70 65 20 29 0d 0a 7b 0d | byte Ty|pe )..{.|
|00002810| 0a 09 72 65 74 75 72 6e | 20 43 6c 65 61 72 52 65 |..return| ClearRe|
|00002820| 73 74 72 69 63 74 69 6f | 6e 28 20 47 65 74 50 6c |strictio|n( GetPl|
|00002830| 61 79 65 72 48 61 73 68 | 28 50 6c 61 79 65 72 49 |ayerHash|(PlayerI|
|00002840| 44 29 2c 20 54 79 70 65 | 29 3b 0d 0a 7d 0d 0a 0d |D), Type|);..}...|
|00002850| 0a 2f 2f 20 55 73 65 64 | 20 74 6f 20 75 70 64 61 |.// Used| to upda|
|00002860| 74 65 20 61 20 72 65 73 | 74 72 69 63 74 69 6f 6e |te a res|triction|
|00002870| 20 69 66 20 63 61 6c 6c | 69 6e 67 20 66 75 6e 63 | if call|ing func|
|00002880| 74 69 6f 6e 20 64 6f 65 | 73 6e 27 74 20 6b 6e 6f |tion doe|sn't kno|
|00002890| 77 20 74 68 65 20 63 75 | 72 72 65 6e 74 20 72 65 |w the cu|rrent re|
|000028a0| 73 74 72 69 63 74 69 6f | 6e 20 6f 66 20 74 68 65 |strictio|n of the|
|000028b0| 20 70 6c 61 79 65 72 0d | 0a 2f 2f 20 54 68 69 73 | player.|.// This|
|000028c0| 20 66 75 6e 63 74 69 6f | 6e 20 63 61 6e 6e 6f 74 | functio|n cannot|
|000028d0| 20 62 65 20 75 73 65 64 | 20 74 6f 20 5f 72 65 6d | be used| to _rem|
|000028e0| 6f 76 65 5f 20 61 20 72 | 65 73 74 72 69 63 74 69 |ove_ a r|estricti|
|000028f0| 6f 6e 20 2d 20 75 73 65 | 20 55 6e 4d 65 72 67 65 |on - use| UnMerge|
|00002900| 20 72 65 73 74 72 69 63 | 74 69 6f 6e 20 69 6e 73 | restric|tion ins|
|00002910| 74 65 61 64 0d 0a 73 69 | 6d 75 6c 61 74 65 64 20 |tead..si|mulated |
|00002920| 66 75 6e 63 74 69 6f 6e | 20 62 6f 6f 6c 20 4d 65 |function| bool Me|
|00002930| 72 67 65 52 65 73 74 72 | 69 63 74 69 6f 6e 28 69 |rgeRestr|iction(i|
|00002940| 6e 74 20 49 6e 64 65 78 | 2c 20 62 79 74 65 20 4e |nt Index|, byte N|
|00002950| 65 77 54 79 70 65 29 0d | 0a 7b 0d 0a 09 69 66 20 |ewType).|.{...if |
|00002960| 28 20 21 49 73 56 61 6c | 69 64 28 49 6e 64 65 78 |( !IsVal|id(Index|
|00002970| 29 20 29 0d 0a 09 09 72 | 65 74 75 72 6e 20 66 61 |) )....r|eturn fa|
|00002980| 6c 73 65 3b 0d 0a 0d 0a | 09 2f 2f 20 46 69 72 73 |lse;....|.// Firs|
|00002990| 74 2c 20 63 6c 65 61 72 | 20 74 68 65 20 62 69 74 |t, clear| the bit|
|000029a0| 73 0d 0a 09 43 68 61 74 | 52 65 73 74 72 69 63 74 |s...Chat|Restrict|
|000029b0| 69 6f 6e 73 5b 49 6e 64 | 65 78 5d 2e 52 65 73 74 |ions[Ind|ex].Rest|
|000029c0| 72 69 63 74 69 6f 6e 20 | 3d 20 43 68 61 74 52 65 |riction |= ChatRe|
|000029d0| 73 74 72 69 63 74 69 6f | 6e 73 5b 49 6e 64 65 78 |strictio|ns[Index|
|000029e0| 5d 2e 52 65 73 74 72 69 | 63 74 69 6f 6e 20 26 20 |].Restri|ction & |
|000029f0| 7e 4e 65 77 54 79 70 65 | 3b 0d 0a 0d 0a 09 2f 2f |~NewType|;.....//|
|00002a00| 20 4e 6f 77 2c 20 73 65 | 74 20 74 68 65 20 62 69 | Now, se|t the bi|
|00002a10| 74 73 0d 0a 09 43 68 61 | 74 52 65 73 74 72 69 63 |ts...Cha|tRestric|
|00002a20| 74 69 6f 6e 73 5b 49 6e | 64 65 78 5d 2e 52 65 73 |tions[In|dex].Res|
|00002a30| 74 72 69 63 74 69 6f 6e | 20 3d 20 43 68 61 74 52 |triction| = ChatR|
|00002a40| 65 73 74 72 69 63 74 69 | 6f 6e 73 5b 49 6e 64 65 |estricti|ons[Inde|
|00002a50| 78 5d 2e 52 65 73 74 72 | 69 63 74 69 6f 6e 20 7c |x].Restr|iction ||
|00002a60| 20 4e 65 77 54 79 70 65 | 3b 0d 0a 0d 0a 09 69 66 | NewType|;.....if|
|00002a70| 20 28 20 49 73 4c 6f 63 | 61 6c 28 29 20 29 0d 0a | ( IsLoc|al() )..|
|00002a80| 09 7b 0d 0a 09 09 53 74 | 6f 72 65 43 68 61 74 42 |.{....St|oreChatB|
|00002a90| 61 6e 28 43 68 61 74 52 | 65 73 74 72 69 63 74 69 |an(ChatR|estricti|
|00002aa0| 6f 6e 73 5b 49 6e 64 65 | 78 5d 2e 50 6c 61 79 65 |ons[Inde|x].Playe|
|00002ab0| 72 48 61 73 68 2c 20 43 | 68 61 74 52 65 73 74 72 |rHash, C|hatRestr|
|00002ac0| 69 63 74 69 6f 6e 73 5b | 49 6e 64 65 78 5d 2e 52 |ictions[|Index].R|
|00002ad0| 65 73 74 72 69 63 74 69 | 6f 6e 29 3b 0d 0a 09 09 |estricti|on);....|
|00002ae0| 53 61 76 65 43 6f 6e 66 | 69 67 28 29 3b 0d 0a 09 |SaveConf|ig();...|
|00002af0| 7d 0d 0a 0d 0a 09 72 65 | 74 75 72 6e 20 54 72 75 |}.....re|turn Tru|
|00002b00| 65 3b 0d 0a 7d 0d 0a 0d | 0a 73 69 6d 75 6c 61 74 |e;..}...|.simulat|
|00002b10| 65 64 20 66 75 6e 63 74 | 69 6f 6e 20 62 6f 6f 6c |ed funct|ion bool|
|00002b20| 20 55 6e 4d 65 72 67 65 | 52 65 73 74 72 69 63 74 | UnMerge|Restrict|
|00002b30| 69 6f 6e 28 69 6e 74 20 | 49 6e 64 65 78 2c 20 62 |ion(int |Index, b|
|00002b40| 79 74 65 20 4e 65 77 54 | 79 70 65 29 0d 0a 7b 0d |yte NewT|ype)..{.|
|00002b50| 0a 09 69 66 20 28 20 21 | 49 73 56 61 6c 69 64 28 |..if ( !|IsValid(|
|00002b60| 49 6e 64 65 78 29 20 29 | 0d 0a 09 09 72 65 74 75 |Index) )|....retu|
|00002b70| 72 6e 20 66 61 6c 73 65 | 3b 0d 0a 0d 0a 09 69 66 |rn false|;.....if|
|00002b80| 20 28 20 21 62 6f 6f 6c | 28 43 68 61 74 52 65 73 | ( !bool|(ChatRes|
|00002b90| 74 72 69 63 74 69 6f 6e | 73 5b 49 6e 64 65 78 5d |triction|s[Index]|
|00002ba0| 2e 52 65 73 74 72 69 63 | 74 69 6f 6e 20 26 20 4e |.Restric|tion & N|
|00002bb0| 65 77 54 79 70 65 29 20 | 29 0d 0a 09 09 72 65 74 |ewType) |)....ret|
|00002bc0| 75 72 6e 20 46 61 6c 73 | 65 3b 0d 0a 0d 0a 09 43 |urn Fals|e;.....C|
|00002bd0| 68 61 74 52 65 73 74 72 | 69 63 74 69 6f 6e 73 5b |hatRestr|ictions[|
|00002be0| 49 6e 64 65 78 5d 2e 52 | 65 73 74 72 69 63 74 69 |Index].R|estricti|
|00002bf0| 6f 6e 20 3d 20 43 68 61 | 74 52 65 73 74 72 69 63 |on = Cha|tRestric|
|00002c00| 74 69 6f 6e 73 5b 49 6e | 64 65 78 5d 2e 52 65 73 |tions[In|dex].Res|
|00002c10| 74 72 69 63 74 69 6f 6e | 20 26 20 7e 4e 65 77 54 |triction| & ~NewT|
|00002c20| 79 70 65 3b 0d 0a 09 69 | 66 20 28 20 49 73 4c 6f |ype;...i|f ( IsLo|
|00002c30| 63 61 6c 28 29 20 29 0d | 0a 09 7b 0d 0a 09 09 53 |cal() ).|..{....S|
|00002c40| 74 6f 72 65 43 68 61 74 | 42 61 6e 28 43 68 61 74 |toreChat|Ban(Chat|
|00002c50| 52 65 73 74 72 69 63 74 | 69 6f 6e 73 5b 49 6e 64 |Restrict|ions[Ind|
|00002c60| 65 78 5d 2e 50 6c 61 79 | 65 72 48 61 73 68 2c 20 |ex].Play|erHash, |
|00002c70| 43 68 61 74 52 65 73 74 | 72 69 63 74 69 6f 6e 73 |ChatRest|rictions|
|00002c80| 5b 49 6e 64 65 78 5d 2e | 52 65 73 74 72 69 63 74 |[Index].|Restrict|
|00002c90| 69 6f 6e 29 3b 0d 0a 09 | 09 53 61 76 65 43 6f 6e |ion);...|.SaveCon|
|00002ca0| 66 69 67 28 29 3b 0d 0a | 09 7d 0d 0a 0d 0a 09 72 |fig();..|.}.....r|
|00002cb0| 65 74 75 72 6e 20 54 72 | 75 65 3b 0d 0a 7d 0d 0a |eturn Tr|ue;..}..|
|00002cc0| 0d 0a 2f 2f 23 23 23 23 | 23 23 23 23 23 23 23 23 |..//####|########|
|00002cd0| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00002ce0| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00002cf0| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00002d00| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00002d10| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00002d20| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00002d30| 23 23 23 0d 0a 2f 2f 0d | 0a 2f 2f 0d 0a 2f 2f 09 |###..//.|.//..//.|
|00002d40| 09 51 75 65 72 79 20 66 | 75 6e 63 74 69 6f 6e 73 |.Query f|unctions|
|00002d50| 0d 0a 2f 2f 0d 0a 0d 0a | 73 69 6d 75 6c 61 74 65 |..//....|simulate|
|00002d60| 64 20 66 75 6e 63 74 69 | 6f 6e 20 62 79 74 65 20 |d functi|on byte |
|00002d70| 47 65 74 50 6c 61 79 65 | 72 52 65 73 74 72 69 63 |GetPlaye|rRestric|
|00002d80| 74 69 6f 6e 28 69 6e 74 | 20 50 6c 61 79 65 72 49 |tion(int| PlayerI|
|00002d90| 44 29 0d 0a 7b 0d 0a 09 | 6c 6f 63 61 6c 20 69 6e |D)..{...|local in|
|00002da0| 74 20 69 3b 0d 0a 0d 0a | 09 69 20 3d 20 47 65 74 |t i;....|.i = Get|
|00002db0| 49 44 49 6e 64 65 78 28 | 50 6c 61 79 65 72 49 44 |IDIndex(|PlayerID|
|00002dc0| 29 3b 0d 0a 09 69 66 20 | 28 20 21 49 73 56 61 6c |);...if |( !IsVal|
|00002dd0| 69 64 28 69 29 20 29 0d | 0a 09 09 72 65 74 75 72 |id(i) ).|...retur|
|00002de0| 6e 20 53 75 70 65 72 2e | 47 65 74 50 6c 61 79 65 |n Super.|GetPlaye|
|00002df0| 72 52 65 73 74 72 69 63 | 74 69 6f 6e 28 50 6c 61 |rRestric|tion(Pla|
|00002e00| 79 65 72 49 44 29 3b 0d | 0a 0d 0a 09 72 65 74 75 |yerID);.|....retu|
|00002e10| 72 6e 20 43 68 61 74 52 | 65 73 74 72 69 63 74 69 |rn ChatR|estricti|
|00002e20| 6f 6e 73 5b 69 5d 2e 52 | 65 73 74 72 69 63 74 69 |ons[i].R|estricti|
|00002e30| 6f 6e 3b 0d 0a 7d 0d 0a | 0d 0a 73 69 6d 75 6c 61 |on;..}..|..simula|
|00002e40| 74 65 64 20 66 75 6e 63 | 74 69 6f 6e 20 62 6f 6f |ted func|tion boo|
|00002e50| 6c 20 43 6c 69 65 6e 74 | 49 73 42 61 6e 6e 65 64 |l Client|IsBanned|
|00002e60| 28 73 74 72 69 6e 67 20 | 50 6c 61 79 65 72 48 61 |(string |PlayerHa|
|00002e70| 73 68 29 0d 0a 7b 0d 0a | 09 6c 6f 63 61 6c 20 69 |sh)..{..|.local i|
|00002e80| 6e 74 20 69 3b 0d 0a 0d | 0a 09 69 66 20 28 20 50 |nt i;...|..if ( P|
|00002e90| 6c 61 79 65 72 48 61 73 | 68 20 3d 3d 20 22 22 20 |layerHas|h == "" |
|00002ea0| 29 0d 0a 09 09 72 65 74 | 75 72 6e 20 54 72 75 65 |)....ret|urn True|
|00002eb0| 3b 0d 0a 0d 0a 09 66 6f | 72 20 28 69 20 3d 20 30 |;.....fo|r (i = 0|
|00002ec0| 3b 20 69 20 3c 20 43 68 | 61 74 52 65 73 74 72 69 |; i < Ch|atRestri|
|00002ed0| 63 74 69 6f 6e 73 2e 4c | 65 6e 67 74 68 3b 20 69 |ctions.L|ength; i|
|00002ee0| 2b 2b 29 0d 0a 09 09 69 | 66 20 28 43 68 61 74 52 |++)....i|f (ChatR|
|00002ef0| 65 73 74 72 69 63 74 69 | 6f 6e 73 5b 69 5d 2e 50 |estricti|ons[i].P|
|00002f00| 6c 61 79 65 72 48 61 73 | 68 20 3d 3d 20 50 6c 61 |layerHas|h == Pla|
|00002f10| 79 65 72 48 61 73 68 29 | 0d 0a 09 09 09 72 65 74 |yerHash)|.....ret|
|00002f20| 75 72 6e 20 62 6f 6f 6c | 28 43 68 61 74 52 65 73 |urn bool|(ChatRes|
|00002f30| 74 72 69 63 74 69 6f 6e | 73 5b 69 5d 2e 52 65 73 |triction|s[i].Res|
|00002f40| 74 72 69 63 74 69 6f 6e | 20 26 20 42 41 4e 4e 45 |triction| & BANNE|
|00002f50| 44 29 3b 0d 0a 0d 0a 09 | 72 65 74 75 72 6e 20 53 |D);.....|return S|
|00002f60| 75 70 65 72 2e 43 6c 69 | 65 6e 74 49 73 42 61 6e |uper.Cli|entIsBan|
|00002f70| 6e 65 64 28 50 6c 61 79 | 65 72 48 61 73 68 29 3b |ned(Play|erHash);|
|00002f80| 0d 0a 7d 0d 0a 0d 0a 73 | 69 6d 75 6c 61 74 65 64 |..}....s|imulated|
|00002f90| 20 70 72 6f 74 65 63 74 | 65 64 20 66 75 6e 63 74 | protect|ed funct|
|00002fa0| 69 6f 6e 20 73 74 72 69 | 6e 67 20 47 65 74 50 6c |ion stri|ng GetPl|
|00002fb0| 61 79 65 72 48 61 73 68 | 28 69 6e 74 20 50 6c 61 |ayerHash|(int Pla|
|00002fc0| 79 65 72 49 44 29 0d 0a | 7b 0d 0a 09 6c 6f 63 61 |yerID)..|{...loca|
|00002fd0| 6c 20 69 6e 74 20 69 3b | 0d 0a 0d 0a 09 69 66 20 |l int i;|.....if |
|00002fe0| 28 20 50 6c 61 79 65 72 | 49 44 20 3c 20 31 20 29 |( Player|ID < 1 )|
|00002ff0| 0d 0a 09 09 72 65 74 75 | 72 6e 20 22 22 3b 0d 0a |....retu|rn "";..|
|00003000| 0d 0a 09 66 6f 72 20 28 | 20 69 20 3d 20 30 3b 20 |...for (| i = 0; |
|00003010| 69 20 3c 20 43 68 61 74 | 52 65 73 74 72 69 63 74 |i < Chat|Restrict|
|00003020| 69 6f 6e 73 2e 4c 65 6e | 67 74 68 3b 20 69 2b 2b |ions.Len|gth; i++|
|00003030| 20 29 0d 0a 09 7b 0d 0a | 09 09 6c 6f 67 28 4e 61 | )...{..|..log(Na|
|00003040| 6d 65 40 22 47 65 74 50 | 6c 61 79 65 72 48 61 73 |me@"GetP|layerHas|
|00003050| 68 20 4d 61 74 63 68 3a | 22 24 50 6c 61 79 65 72 |h Match:|"$Player|
|00003060| 49 44 40 22 54 65 73 74 | 5b 22 24 69 24 22 5d 3a |ID@"Test|["$i$"]:|
|00003070| 22 24 43 68 61 74 52 65 | 73 74 72 69 63 74 69 6f |"$ChatRe|strictio|
|00003080| 6e 73 5b 69 5d 2e 50 6c | 61 79 65 72 49 44 29 3b |ns[i].Pl|ayerID);|
|00003090| 0d 0a 09 09 69 66 20 28 | 20 43 68 61 74 52 65 73 |....if (| ChatRes|
|000030a0| 74 72 69 63 74 69 6f 6e | 73 5b 69 5d 2e 50 6c 61 |triction|s[i].Pla|
|000030b0| 79 65 72 49 44 20 3d 3d | 20 50 6c 61 79 65 72 49 |yerID ==| PlayerI|
|000030c0| 44 20 29 0d 0a 09 09 09 | 72 65 74 75 72 6e 20 43 |D ).....|return C|
|000030d0| 68 61 74 52 65 73 74 72 | 69 63 74 69 6f 6e 73 5b |hatRestr|ictions[|
|000030e0| 69 5d 2e 50 6c 61 79 65 | 72 48 61 73 68 3b 0d 0a |i].Playe|rHash;..|
|000030f0| 09 7d 0d 0a 0d 0a 09 72 | 65 74 75 72 6e 20 22 22 |.}.....r|eturn ""|
|00003100| 3b 0d 0a 7d 0d 0a 0d 0a | 73 69 6d 75 6c 61 74 65 |;..}....|simulate|
|00003110| 64 20 70 72 6f 74 65 63 | 74 65 64 20 66 75 6e 63 |d protec|ted func|
|00003120| 74 69 6f 6e 20 69 6e 74 | 20 47 65 74 49 44 49 6e |tion int| GetIDIn|
|00003130| 64 65 78 28 69 6e 74 20 | 50 6c 61 79 65 72 49 44 |dex(int |PlayerID|
|00003140| 29 0d 0a 7b 0d 0a 09 6c | 6f 63 61 6c 20 69 6e 74 |)..{...l|ocal int|
|00003150| 20 69 3b 0d 0a 0d 0a 09 | 69 66 20 28 20 50 6c 61 | i;.....|if ( Pla|
|00003160| 79 65 72 49 44 20 3c 20 | 31 20 29 0d 0a 09 09 72 |yerID < |1 )....r|
|00003170| 65 74 75 72 6e 20 2d 31 | 3b 0d 0a 0d 0a 09 66 6f |eturn -1|;.....fo|
|00003180| 72 20 28 20 69 20 3d 20 | 30 3b 20 69 20 3c 20 43 |r ( i = |0; i < C|
|00003190| 68 61 74 52 65 73 74 72 | 69 63 74 69 6f 6e 73 2e |hatRestr|ictions.|
|000031a0| 4c 65 6e 67 74 68 3b 20 | 69 2b 2b 20 29 0d 0a 09 |Length; |i++ )...|
|000031b0| 09 69 66 20 28 20 43 68 | 61 74 52 65 73 74 72 69 |.if ( Ch|atRestri|
|000031c0| 63 74 69 6f 6e 73 5b 69 | 5d 2e 50 6c 61 79 65 72 |ctions[i|].Player|
|000031d0| 49 44 20 3d 3d 20 50 6c | 61 79 65 72 49 44 20 29 |ID == Pl|ayerID )|
|000031e0| 0d 0a 09 09 09 72 65 74 | 75 72 6e 20 69 3b 0d 0a |.....ret|urn i;..|
|000031f0| 0d 0a 09 72 65 74 75 72 | 6e 20 2d 31 3b 0d 0a 7d |...retur|n -1;..}|
|00003200| 0d 0a 0d 0a 73 69 6d 75 | 6c 61 74 65 64 20 70 72 |....simu|lated pr|
|00003210| 6f 74 65 63 74 65 64 20 | 66 75 6e 63 74 69 6f 6e |otected |function|
|00003220| 20 69 6e 74 20 47 65 74 | 48 61 73 68 49 6e 64 65 | int Get|HashInde|
|00003230| 78 28 73 74 72 69 6e 67 | 20 50 6c 61 79 65 72 48 |x(string| PlayerH|
|00003240| 61 73 68 29 0d 0a 7b 0d | 0a 09 6c 6f 63 61 6c 20 |ash)..{.|..local |
|00003250| 69 6e 74 20 69 3b 0d 0a | 0d 0a 09 69 66 20 28 20 |int i;..|...if ( |
|00003260| 50 6c 61 79 65 72 48 61 | 73 68 20 3d 3d 20 22 22 |PlayerHa|sh == ""|
|00003270| 20 29 0d 0a 09 09 72 65 | 74 75 72 6e 20 2d 31 3b | )....re|turn -1;|
|00003280| 0d 0a 0d 0a 09 66 6f 72 | 20 28 20 69 20 3d 20 30 |.....for| ( i = 0|
|00003290| 3b 20 69 20 3c 20 43 68 | 61 74 52 65 73 74 72 69 |; i < Ch|atRestri|
|000032a0| 63 74 69 6f 6e 73 2e 4c | 65 6e 67 74 68 3b 20 69 |ctions.L|ength; i|
|000032b0| 2b 2b 20 29 0d 0a 09 09 | 69 66 20 28 20 43 68 61 |++ )....|if ( Cha|
|000032c0| 74 52 65 73 74 72 69 63 | 74 69 6f 6e 73 5b 69 5d |tRestric|tions[i]|
|000032d0| 2e 50 6c 61 79 65 72 48 | 61 73 68 20 3d 3d 20 50 |.PlayerH|ash == P|
|000032e0| 6c 61 79 65 72 48 61 73 | 68 20 29 0d 0a 09 09 09 |layerHas|h ).....|
|000032f0| 72 65 74 75 72 6e 20 69 | 3b 0d 0a 0d 0a 09 72 65 |return i|;.....re|
|00003300| 74 75 72 6e 20 2d 31 3b | 0d 0a 7d 0d 0a 0d 0a 73 |turn -1;|..}....s|
|00003310| 69 6d 75 6c 61 74 65 64 | 20 70 72 6f 74 65 63 74 |imulated| protect|
|00003320| 65 64 20 66 75 6e 63 74 | 69 6f 6e 20 62 6f 6f 6c |ed funct|ion bool|
|00003330| 20 49 73 56 61 6c 69 64 | 28 69 6e 74 20 69 29 0d | IsValid|(int i).|
|00003340| 0a 7b 0d 0a 09 72 65 74 | 75 72 6e 20 69 20 3e 3d |.{...ret|urn i >=|
|00003350| 20 30 20 26 26 20 69 20 | 3c 20 43 68 61 74 52 65 | 0 && i |< ChatRe|
|00003360| 73 74 72 69 63 74 69 6f | 6e 73 2e 4c 65 6e 67 74 |strictio|ns.Lengt|
|00003370| 68 3b 0d 0a 7d 0d 0a 0d | 0a 73 69 6d 75 6c 61 74 |h;..}...|.simulat|
|00003380| 65 64 20 66 75 6e 63 74 | 69 6f 6e 20 62 6f 6f 6c |ed funct|ion bool|
|00003390| 20 49 73 4c 6f 63 61 6c | 28 29 0d 0a 7b 0d 0a 09 | IsLocal|()..{...|
|000033a0| 72 65 74 75 72 6e 20 4c | 65 76 65 6c 2e 4e 65 74 |return L|evel.Net|
|000033b0| 4d 6f 64 65 20 3d 3d 20 | 4e 4d 5f 43 6c 69 65 6e |Mode == |NM_Clien|
|000033c0| 74 20 7c 7c 0d 0a 09 09 | 28 4c 65 76 65 6c 2e 4e |t ||....|(Level.N|
|000033d0| 65 74 4d 6f 64 65 20 3d | 3d 20 4e 4d 5f 4c 69 73 |etMode =|= NM_Lis|
|000033e0| 74 65 6e 53 65 72 76 65 | 72 20 26 26 0d 0a 09 09 |tenServe|r &&....|
|000033f0| 50 6c 61 79 65 72 4f 77 | 6e 65 72 20 21 3d 20 4e |PlayerOw|ner != N|
|00003400| 6f 6e 65 20 26 26 20 50 | 6c 61 79 65 72 4f 77 6e |one && P|layerOwn|
|00003410| 65 72 20 3d 3d 20 4c 65 | 76 65 6c 2e 47 65 74 4c |er == Le|vel.GetL|
|00003420| 6f 63 61 6c 50 6c 61 79 | 65 72 43 6f 6e 74 72 6f |ocalPlay|erContro|
|00003430| 6c 6c 65 72 28 29 29 3b | 0d 0a 7d 0d 0a 0d 0a 73 |ller());|..}....s|
|00003440| 69 6d 75 6c 61 74 65 64 | 20 66 75 6e 63 74 69 6f |imulated| functio|
|00003450| 6e 20 69 6e 74 20 43 6f | 75 6e 74 28 29 0d 0a 7b |n int Co|unt()..{|
|00003460| 0d 0a 09 72 65 74 75 72 | 6e 20 43 68 61 74 52 65 |...retur|n ChatRe|
|00003470| 73 74 72 69 63 74 69 6f | 6e 73 2e 4c 65 6e 67 74 |strictio|ns.Lengt|
|00003480| 68 3b 0d 0a 7d 0d 0a 0d | 0a 00 |h;..}...|.. |
+--------+-------------------------+-------------------------+--------+--------+