Skip to content

Commit

Permalink
bugfix + silence
Browse files Browse the repository at this point in the history
  • Loading branch information
stonedDiscord committed Dec 29, 2017
1 parent 9da1c58 commit 1acf782
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 33 deletions.
16 changes: 8 additions & 8 deletions AOprivateServer.pbp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<section name="data">
<explorer view="" pattern="8"/>
<log show="1"/>
<lastopen date="2017-09-06 02:54" user="sD" host="DESKTOP-6E31U1E"/>
<lastopen date="2017-12-29 21:36" user="sven" host="DESKTOP-I7MA5HM"/>
</section>
<section name="files">
<file name="Common.pb">
Expand All @@ -20,15 +20,15 @@
</file>
<file name="main.pb">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" panelstate="+"/>
<fingerprint md5="577689a50a76f182965482a526a01124"/>
<fingerprint md5="c24bb3cb668621fddc029cb0db9e2823"/>
</file>
<file name="server_shared.pb">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" panelstate="+"/>
<fingerprint md5="2d3d5d4520f14beb20560f3835b8967c"/>
<fingerprint md5="932cd11b8d61dae4627b623e395c556d"/>
</file>
<file name="shared_headers.pb">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" panelstate="+"/>
<fingerprint md5="fad64bb265ad9906c414be6c996904a5"/>
<fingerprint md5="78ad892a1f3925789f2a2af1eb627d5a"/>
</file>
</section>
<section name="targets">
Expand All @@ -41,8 +41,8 @@
<icon enable="1">sD.ico</icon>
<format exe="default" cpu="2"/>
<debugger custom="1" type="ide"/>
<compilecount enable="1" value="1373"/>
<buildcount enable="1" value="152"/>
<compilecount enable="1" value="1363"/>
<buildcount enable="1" value="154"/>
<versioninfo enable="1">
<field0 value="2,%COMPILECOUNT,%BUILDCOUNT,0"/>
<field1 value="2.%COMPILECOUNT.%BUILDCOUNT,0"/>
Expand Down Expand Up @@ -76,8 +76,8 @@
<icon enable="0">owner.ico</icon>
<format exe="console" cpu="0"/>
<debugger custom="1" type="ide"/>
<compilecount enable="1" value="1361"/>
<buildcount enable="1" value="152"/>
<compilecount enable="1" value="1363"/>
<buildcount enable="1" value="154"/>
<versioninfo enable="1">
<field0 value="2,%COMPILECOUNT,%BUILDCOUNT,0"/>
<field1 value="2,%COMPILECOUNT,%BUILDCOUNT,0"/>
Expand Down
47 changes: 33 additions & 14 deletions main.pb
Original file line number Diff line number Diff line change
Expand Up @@ -1105,20 +1105,21 @@ Procedure KickBan(kick$,param$,action,*usagePointer.Client)
Clients()\ignore=0
actionn$="undignored"
akck+1
ResetList(Actions())
While NextElement(Actions())
If Actions()\IP=Clients()\IP And Actions()\type=#CIGNORE
DeleteElement(Actions())
EndIf
Wend

Case #SILENCE
Clients()\silence=1
actionn$="ignored"
akck+1

Case #UNSILENCE
Clients()\silence=0
actionn$="unsilenced"
akck+1

Case #UNDJ
Clients()\ignoremc=1
actionn$="undj'd"
akck+1
AddElement(Actions())
Actions()\IP=Clients()\IP
Actions()\type=#UNDJ

Case #DJ
Clients()\ignoremc=0
Expand Down Expand Up @@ -1480,6 +1481,7 @@ Procedure HandleAOCommand(ClientID)
Case "/bg"
If *usagePointer\perm
bgcomm$=Mid(ctparam$,5)
Debug bgcomm$
Channels(*usagePointer\area)\bg=bgcomm$
Sendtarget("Area"+Str(*usagePointer\area),"BN#"+bgcomm$+"#%",*usagePointer)
EndIf
Expand All @@ -1488,8 +1490,10 @@ Procedure HandleAOCommand(ClientID)
npos$=Mid(ctparam$,6)
If npos$="def" Or npos$="pro" Or npos$="hlp" Or npos$="hld" Or npos$="wit" Or npos$="jud"
*usagePointer\pos=npos$
SendTarget(Str(ClientID),"CT#$HOST#Your position is now: "+*usagePointer\pos+"#%",Server)
Else
*usagePointer\pos=""
SendTarget(Str(ClientID),"CT#$HOST#You're back in the default position#%",Server)
EndIf

Case "/g"
Expand Down Expand Up @@ -1660,11 +1664,13 @@ Procedure HandleAOCommand(ClientID)
Case "/skip"
If *usagePointer\perm
*usagePointer\skip=1
SendTarget(Str(ClientID),"CT#$HOST#You can now skip others#%",Server)
EndIf

Case "/noskip"
If *usagePointer\perm
*usagePointer\skip=0
SendTarget(Str(ClientID),"CT#$HOST#You can no longer skip others#%",Server)
EndIf

Case "/toggle"
Expand Down Expand Up @@ -1934,6 +1940,18 @@ Procedure HandleAOCommand(ClientID)
SendTarget(Str(ClientID),"CT#$HOST#unmuted "+Str(akck)+" clients#%",Server)
EndIf

Case "/silence"
If *usagePointer\perm>=#MOD
akck=KickBan(Mid(ctparam$,10),StringField(ctparam$,3," "),#SILENCE,*usagePointer)
SendTarget(Str(ClientID),"CT#$HOST#silenced "+Str(akck)+" clients#%",Server)
EndIf


Case "/unsilence"
If *usagePointer\perm>=#MOD
akck=KickBan(Mid(ctparam$,12),StringField(ctparam$,3," "),#UNSILENCE,*usagePointer)
SendTarget(Str(ClientID),"CT#$HOST#unsilenced "+Str(akck)+" clients#%",Server)
EndIf

Case "/undj"
If *usagePointer\perm>=#MOD
Expand Down Expand Up @@ -2626,7 +2644,7 @@ Procedure Network(var)
Case #PB_NetworkEvent_Data ;- Received Data
*usagePointer.Client=FindMapElement(Clients(),Str(ClientID))
If *usagePointer
length=ReceiveNetworkData(ClientID,*Buffer,1024)
length=ReceiveNetworkData(ClientID,*Buffer,2048)
If length
rawreceive$=PeekS(*Buffer,length)
Debug rawreceive$
Expand Down Expand Up @@ -2694,7 +2712,8 @@ Procedure Network(var)

sc=1
While StringField(rawreceive$,sc,"%")<>""
subcommand$=ValidateChars(StringField(rawreceive$,sc,"%")+"%")
subcommand$=ValidateChars(StringField(rawreceive$,sc,"%"))
Debug subcommand$
length=Len(subcommand$)

If ExpertLog
Expand Down Expand Up @@ -2761,7 +2780,7 @@ CompilerElse
success=CreateNetworkServer(0,Port,#PB_Network_TCP)
If success

*Buffer = AllocateMemory(1024)
*Buffer = AllocateMemory(2048)

WriteLog("Server started",Server)

Expand Down Expand Up @@ -2799,7 +2818,7 @@ CompilerEndIf

End
; IDE Options = PureBasic 5.31 (Windows - x86)
; CursorPosition = 2535
; FirstLine = 2517
; CursorPosition = 1483
; FirstLine = 1466
; Folding = ------
; EnableXP
Binary file modified serverD.exe
Binary file not shown.
Binary file modified serverDco.exe
Binary file not shown.
9 changes: 6 additions & 3 deletions server_shared.pb
Original file line number Diff line number Diff line change
Expand Up @@ -535,10 +535,13 @@ Procedure SendChatMessage(*ntmes.ChatMessage,*seUser.Client)
EndIf
Channels(*seUser\area)\waitstart=ElapsedMilliseconds()
Channels(*seUser\area)\waitdur=Len(*ntmes\message)*40
If Channels(*seUser\area)\waitdur>600
Channels(*seUser\area)\waitdur=1
EndIf
LockMutex(ListMutex)
ResetMap(Clients())
While NextMapElement(Clients())
If Clients()\area=*seUser\area
If Clients()\area=*seUser\area And (*seUser\silence=0 Or *seUser=Clients())
Select Clients()\type
CompilerIf #WEB
Case #WEBSOCKET
Expand Down Expand Up @@ -613,7 +616,7 @@ Procedure TrackWait(a)
Until LoopMusic=0
EndProcedure
; IDE Options = PureBasic 5.31 (Windows - x86)
; CursorPosition = 435
; FirstLine = 417
; CursorPosition = 539
; FirstLine = 503
; Folding = ------
; EnableXP
7 changes: 3 additions & 4 deletions serverd.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[Version]
Compile=1377
Build=152
0.0.0.0
WD-WX21EA45MECN
Compile=1362
Build=153
0.0.0.0
7 changes: 5 additions & 2 deletions shared_headers.pb
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ Structure Client
type.b
perm.w
ignore.b
silence.b
ignoremc.b
hack.b
gimp.b
Expand Down Expand Up @@ -172,6 +173,8 @@ Enumeration
#UNMUTE
#CIGNORE
#UNIGNORE
#SILENCE
#UNSILENCE
#UNDJ
#DJ
#GIMP
Expand All @@ -180,6 +183,6 @@ Enumeration
#MOVE
EndEnumeration
; IDE Options = PureBasic 5.31 (Windows - x86)
; CursorPosition = 71
; FirstLine = 54
; CursorPosition = 176
; FirstLine = 129
; EnableXP
4 changes: 2 additions & 2 deletions version.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[Version]
Compile=1377
Build=152
Compile=1362
Build=153
0.0.0.0

0 comments on commit 1acf782

Please sign in to comment.