Idea for 0.4: sty+ct(+ap)?

Everything todo with programming goes HERE.
User avatar
aP|Nelg
Match Winner
Posts: 593
Joined: Wed Oct 22, 2014 10:22 pm
Contact:

Idea for 0.4: sty+ct(+ap)?

Post by aP|Nelg »

Half of the servers around here use sty+ct / sty+ct+ap. Why don't we implement features from +ap into 0.4?
Some stuff that is in +ap:
> Reporting with /reports
> More than just 2 colors in a name.
> Speed/Accel zones, object zone
> CENTER_PLAYER_MESSAGE (Send a center message that only appears in that person's screen)
> {More of a client thing}: Color tab completion. (Colored player's names in tab completion)

And quite a lot of stuff in sty+ct too, which would also be too much to name. Mostly additional zones and more player controls though.

User avatar
ConVicT
Shutout Match Winner
Posts: 1004
Joined: Fri Feb 17, 2012 2:33 am

Re: Idea for 0.4: sty+ct(+ap)?

Post by ConVicT »

aP|Nelg wrote: > More than just 2 colors in a name.
That worked at one point, but apparently was a bug and was fixed.
I never understood why it was deemed a bug, didn't bother to ask either.
Why didn't they just see it as a happy accident?

User avatar
kyle
Reverse Outside Corner Grinder
Posts: 1868
Joined: Thu Jun 08, 2006 3:33 pm
Location: Indiana, USA, Earth, Milky Way Galaxy, Universe, Multiverse
Contact:

Re: Idea for 0.4: sty+ct(+ap)?

Post by kyle »

aP|Nelg wrote:> Speed/Accel zones, object zone
This is already part of zonesV2
Image

User avatar
aP|Nelg
Match Winner
Posts: 593
Joined: Wed Oct 22, 2014 10:22 pm
Contact:

Re: Idea for 0.4: sty+ct(+ap)?

Post by aP|Nelg »

ConVicT wrote:
aP|Nelg wrote: > More than just 2 colors in a name.
That worked at one point, but apparently was a bug and was fixed.
I never understood why it was deemed a bug, didn't bother to ask either.
Why didn't they just see it as a happy accident?
Thats not what I meant, I meant the way it is in +ap. You cant have a name longer than a certain length still, but you can set your colors up and the colors aren't included in the length testing. Durf could explain more what I mean probably.

You don't have to depend on admins renaming you either.
kyle wrote:
aP|Nelg wrote:> Speed/Accel zones, object zone
This is already part of zonesV2
Where is the spawn_zone command then? I wanna try it.

User avatar
kyle
Reverse Outside Corner Grinder
Posts: 1868
Joined: Thu Jun 08, 2006 3:33 pm
Location: Indiana, USA, Earth, Milky Way Galaxy, Universe, Multiverse
Contact:

Re: Idea for 0.4: sty+ct(+ap)?

Post by kyle »

Spawn_Zone is something that will have to be implemented, Not near as simple as it was in 0.2.8 since zones don't have to be circles. I'm thinking about maybe including the shape of the zone in a resource file, then give the ability to set position and whatnot, Note: nothing has been coded, and 0.4 zones don't have motion, that's why I think moving zones is the next logical step since CTF has basically been implemented.

Other things to consider
Enhanced ladderlog output, easy, but painstaking to implement ( would suggest just this in it's own branch to hopefully merge in once done)

Once we have moving zones then
-Styball
-shooting
-spawn_zone

Also i think we can hijack some of voodoo's commits for Delayed_command

The other things you mentioned should be pretty straightforward to implement, Just not 100% that all of them would be deemed as desirable to include with it. And sty may not be included until a release after 0.4.

Final note:
try some of thees really old zones_v2 maps by ed
http://crazy-tronners.com/resource/ed/zones_v2/

For instance this has acceleration

Code: Select all

MAP_FILE ed/zones_v2/autumn-0.0.4.aamap.xml(http://crazy-tronners.com/resource/ed/zones_v2/autumn-0.0.4.aamap.xml)
Image

User avatar
/dev/null
Shutout Match Winner
Posts: 820
Joined: Sat Sep 04, 2004 6:28 pm
Location: Chicago-ish

Re: Idea for 0.4: sty+ct(+ap)?

Post by /dev/null »

Nuke from orbit.

User avatar
Z-Man
God & Project Admin
Posts: 11438
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: Idea for 0.4: sty+ct(+ap)?

Post by Z-Man »

aP|Nelg wrote:> Reporting with /reports
> CENTER_PLAYER_MESSAGE (Send a center message that only appears in that person's screen)
Those sound good. Easy to integrate patches welcome.
aP|Nelg wrote:> {More of a client thing}: Color tab completion. (Colored player's names in tab completion)
I'd take that too, even though...
aP|Nelg wrote:> More than just 2 colors in a name.
No. You get 15 characters for your name. You're not supposed to be able to use colours in the first place, but if you absolutely must, we let you waste 8 of those characters for a silly mid-name colour change.

Speed zones should already work in Zones 2.0. I may be wrong. If I am, the way to implement them would be to add the appropriate effect.

User avatar
sinewav
Graphic Artist
Posts: 6348
Joined: Wed Jan 23, 2008 3:37 am
Contact:

Re: Idea for 0.4: sty+ct(+ap)?

Post by sinewav »

aP|Nelg wrote:CENTER_PLAYER_MESSAGE (Send a center message that only appears in that person's screen)
I'm having a hard time imagining this being used in a helpful manner rather than a new way to annoy specific people with spam. Lots of potential for abuse there.

User avatar
Magi
Match Winner
Posts: 633
Joined: Fri Oct 21, 2011 9:35 pm

Re: Idea for 0.4: sty+ct(+ap)?

Post by Magi »

sinewav wrote:
aP|Nelg wrote:CENTER_PLAYER_MESSAGE (Send a center message that only appears in that person's screen)
I'm having a hard time imagining this being used in a helpful manner rather than a new way to annoy specific people with spam. Lots of potential for abuse there.
Sounds like fun we should totally do it
Image Image Image Image Image Image Image Image Image
Image

bye

User avatar
aP|Nelg
Match Winner
Posts: 593
Joined: Wed Oct 22, 2014 10:22 pm
Contact:

Re: Idea for 0.4: sty+ct(+ap)?

Post by aP|Nelg »

sinewav wrote:
aP|Nelg wrote:CENTER_PLAYER_MESSAGE (Send a center message that only appears in that person's screen)
I'm having a hard time imagining this being used in a helpful manner rather than a new way to annoy specific people with spam. Lots of potential for abuse there.
Theres potential that CENTER_MESSAGE will cause spam too... does that mean we should remove that too?
Z-Man wrote:
aP|Nelg wrote:> More than just 2 colors in a name.
No. You get 15 characters for your name. You're not supposed to be able to use colours in the first place, but if you absolutely must, we let you waste 8 of those characters for a silly mid-name colour change.
0x colo(u)r codes aren't technically visible characters though.

User avatar
aP|Nelg
Match Winner
Posts: 593
Joined: Wed Oct 22, 2014 10:22 pm
Contact:

Re: Idea for 0.4: sty+ct(+ap)?

Post by aP|Nelg »

MORE +ap stuff:
> Theres built in racing in +ap. No need for external scripts for racing
> KILL_ALL and RESPAWN_ALL
> Downloading settings from the server (as long as the owner has it allowed and enabled)
> DESTROY_ZONE, DESTROY_ALL and COLLAPSE_ALL (zone commands. Destroying a zone makes it disappear instantly instead of smoothly collapsing {within limitations of lag})
> BANNED_WORDS for banning words and phrases. Way to force rules on someone who refuses to follow them.
> Convert capital color codes to lowercase color codes (except RESETT)
> /chat - Admins can chat privately amongst themselves

I wouldn't recommend LOGIN command because of the potential of forcing someone to login, to steal the player's password. However, it would also be the player's fault for having the password saved on disk instead of having it not being saved. LOGOUT is exactly the same as DEOP.

User avatar
ConVicT
Shutout Match Winner
Posts: 1004
Joined: Fri Feb 17, 2012 2:33 am

Re: Idea for 0.4: sty+ct(+ap)?

Post by ConVicT »

Z-Man wrote:
aP|Nelg wrote:> Reporting with /reports
> CENTER_PLAYER_MESSAGE (Send a center message that only appears in that person's screen)
Those sound good. Easy to integrate patches welcome.
aP|Nelg wrote:> {More of a client thing}: Color tab completion. (Colored player's names in tab completion)
I'd take that too, even though...
aP|Nelg wrote:> More than just 2 colors in a name.
No. You get 15 characters for your name. You're not supposed to be able to use colours in the first place, but if you absolutely must, we let you waste 8 of those characters for a silly mid-name colour change.

Speed zones should already work in Zones 2.0. I may be wrong. If I am, the way to implement them would be to add the appropriate effect.
That was a bit defensive :o
sinewav wrote:
aP|Nelg wrote:CENTER_PLAYER_MESSAGE (Send a center message that only appears in that person's screen)
I'm having a hard time imagining this being used in a helpful manner rather than a new way to annoy specific people with spam. Lots of potential for abuse there.
This just off the top of my head: Imagine (if you've tried a server like HFT) being able to type "/start" and you're shown an inventory that chat can't get in the way of (center message looking like your usual pause-inventory menu) .
Even better could only be:

Code: Select all

FULLSCREEN_PLAYER_MESSAGE

User avatar
aP|Nelg
Match Winner
Posts: 593
Joined: Wed Oct 22, 2014 10:22 pm
Contact:

Re: Idea for 0.4: sty+ct(+ap)?

Post by aP|Nelg »

ConVicT wrote:This just off the top of my head: Imagine (if you've tried a server like HFT) being able to type "/start" and you're shown an inventory that chat can't get in the way of (center message looking like your usual pause-inventory menu) .
Even better could only be:

Code: Select all

FULLSCREEN_PLAYER_MESSAGE
Thanks for the +ap idea, I'll think about whether its a good idea or not for +ap, cause it seems like it would be kind of annoying to have to see a fullscreen message during a game.

User avatar
ConVicT
Shutout Match Winner
Posts: 1004
Joined: Fri Feb 17, 2012 2:33 am

Re: Idea for 0.4: sty+ct(+ap)?

Post by ConVicT »

Let's say when you "/start" you actually type / start <seconds>" whilst you're in fullscreen (pause menu), your chatbot is activated, just as chat would ( I can't tell you it already does do that if you're forced to fullscreen but I reckon it probably does).

User avatar
aP|Nelg
Match Winner
Posts: 593
Joined: Wed Oct 22, 2014 10:22 pm
Contact:

Re: Idea for 0.4: sty+ct(+ap)?

Post by aP|Nelg »

Z-Man wrote:
aP|Nelg wrote:> Reporting with /reports
> CENTER_PLAYER_MESSAGE (Send a center message that only appears in that person's screen)
Those sound good. Easy to integrate patches welcome.

Code: Select all

--- /home/administrator/0.4/src/engine/ePlayer.cpp	2015-11-21 17:36:14.627537000 -0500
+++ /home/administrator/0.4-reporttest/src/engine/ePlayer.cpp	2016-03-23 20:22:08.700856801 -0400
@@ -3228,6 +3228,183 @@
     se_ChatTeam( p, msg, spam );
 }
 
+static void se_ChatReport( ePlayerNetID * p, std::istream & s )
+{
+    tString msg;
+    tOutput reportPlayer;
+    msg.ReadLine(s);
+
+    if (msg != "")
+    {
+        tString reporMsg;
+        reporMsg << st_GetCurrentTime("[%Y/%m/%d-%H:%M:%S]");
+        reporMsg << " ";
+        reporMsg << p->GetMachine().GetIP();
+        reporMsg << " ";
+        reporMsg << p->GetUserName();
+        reporMsg << " ";
+        reporMsg << msg;
+        reporMsg << "\n";
+
+        std::ofstream o;
+        if (tDirectories::Var().Open(o, "reports.txt", std::ios::app))
+        {
+            o << reporMsg;
+            reportPlayer << "$chat_message_report_respond_ok";
+            reportPlayer << msg << "\n";
+        }
+        else
+        {
+            reportPlayer << "$chat_message_report_respond_no";
+        }
+        o.close();
+    }
+    else
+    {
+        reportPlayer << "$chat_message_report_message_empty";
+    }
+    sn_ConsoleOut(reportPlayer, p->Owner());
+}
+
+static int se_ReportsCount()
+{
+    int count = 0;
+
+    std::ifstream i;
+    if (tDirectories::Var().Open(i, "reports.txt"))
+    {
+        while (!i.eof())
+        {
+            std::string sayLine;
+            std::getline(i, sayLine);
+            std::istringstream s(sayLine);
+
+            tString params;
+            params.ReadLine(s);
+
+            if (params != "")
+                count++;
+        }
+    }
+    i.close();
+
+    return count;
+}
+
+static tArray<tString> se_ReportsMessages()
+{
+    tArray<tString> reports;
+
+    std::ifstream i;
+    if (tDirectories::Var().Open(i, "reports.txt"))
+    {
+        while (!i.eof())
+        {
+            std::string sayLine;
+            std::getline(i, sayLine);
+            std::istringstream s(sayLine);
+
+            tString params;
+            params.ReadLine(s);
+            int pos = 0;
+
+            if (params != "")
+                reports.Insert(params);
+        }
+    }
+    i.close();
+
+    return reports;
+}
+
+tAccessLevel se_AccessLevelReportsRead = tAccessLevel_Default;
+static tSettingItem<tAccessLevel> se_AccessLevelReportsReadConf("ACCESS_LEVEL_REPORTS_READ", se_AccessLevelReportsRead);
+
+tAccessLevel se_AccessLevelReportsClear = tAccessLevel_Admin;
+static tSettingItem<tAccessLevel> se_AccessLevelReportsClearConf("ACCESS_LEVEL_REPORTS_CLEAR", se_AccessLevelReportsClear);
+
+static void se_ChatReadReport( ePlayerNetID * p, std::istream & s )
+{
+    tString type;
+    s >> type;
+
+    if ((type == "") || (type.ToLower() == "list"))
+    {
+        tOutput msg;
+        msg.SetTemplateParameter(1, se_ReportsCount());
+        msg << "$read_reports_count";
+        sn_ConsoleOut(msg, p->Owner());
+    }
+    else if (type.ToLower() == "read")
+    {
+        if (p->GetAccessLevel() > se_AccessLevelReportsRead)
+        {
+            sn_ConsoleOut(tOutput("$read_reports_access_no_read"), p->Owner());
+            return;
+        }
+
+        tString lineNoStr;
+        s >> lineNoStr;
+        if (lineNoStr == "")
+        {
+            sn_ConsoleOut(tOutput("$chat_message_report_read_usage"), p->Owner());
+            return;
+        }
+
+        int lineNo = atoi(lineNoStr);
+        int index  = lineNo - 1;
+
+        tArray<tString> report_messages = se_ReportsMessages();
+
+        if ((index < 0) || (index >= report_messages.Len()))
+        {
+            sn_ConsoleOut(tOutput("$chat_message_report_read_none", lineNo), p->Owner());
+            return;
+        }
+
+        tString msg = report_messages[index];
+        int pos = 0;
+        int lnum = 0;
+        tArray<tString> reportSplit;
+        
+        while(lnum++ <= 3)
+        {
+            if(lnum > 1)pos = msg.StrPos(pos," ")+1;
+            tString str = msg.SubStr(pos);
+            int stringLen=str.StrPos(" ");str.RemoveSubStr(stringLen,str.length()-stringLen);
+            reportSplit.Insert(str);
+            std::cout << str << "|" << pos << "/" << str.StrPos(" ") << "/" << str.length() << "\n";
+        }
+        
+
+        tString pMsg;
+        pMsg << "Report " << lineNo << " by " << reportSplit[2];
+        if(p->GetAccessLevel() <= se_ipAccessLevel)
+        {
+            pMsg << "@" << reportSplit[1];
+        }
+        pMsg << " at " << reportSplit[0] << ": " << msg.SubStr(pos) << "\n";
+        sn_ConsoleOut(pMsg, p->Owner());
+    }
+    else if (type.ToLower() == "clear")
+    {
+        if (p->GetAccessLevel() > se_AccessLevelReportsClear)
+        {
+            sn_ConsoleOut(tOutput("$read_reports_access_no_clear"), p->Owner());
+            return;
+        }
+
+        std::ofstream o;
+        if (tDirectories::Var().Open(o, "reports.txt"))
+        {
+            o << "\n";
+        }
+        o.close();
+
+        sn_ConsoleOut(tOutput("$read_reports_cleared"), p->Owner());
+    }
+}
+
 // /msg chat commant: talk to anyone team
 static void se_ChatMsg( ePlayerNetID * p, std::istream & s, eChatSpamTester & spam )
 {
@@ -3965,6 +4142,23 @@
                         se_ChatTeam( p, s, spam );
                         return;
                     }
+                    else if (command == "/report")
+                    {
+                        spam.factor_ = 1;
+                        if ( spam.Block() )
+                        {
+                            return;
+                        }
+                        spam.lastSaidType_ = eChatMessageType_Public;
+                        se_ChatReport( p, s );
+                        return;
+                    }
+                    else if (command == "/reports")
+                    {
+                        spam.lastSaidType_ = eChatMessageType_Public;
+                        se_ChatReadReport( p, s );
+                        return;
+                    }
                     else if (command == "/shout")
                     {
                         spam.lastSaidType_ = eChatMessageType_Public;

Code: Select all

--- /home/administrator/0.4/language/english_base.txt	2015-11-21 17:36:14.627537000 -0500
+++ /home/administrator/0.4-reporttest/language/english_base.txt	2016-03-22 00:51:10.842454021 -0400
@@ -3547,6 +3547,16 @@
 chat_command_unknown        Unknown chat command "\1".\n
 chat_command_accesslevel    Sorry, your access level is not high enough to use the "\1" command. You're \2, required would be \3.\n
 
+read_reports_count                 There are \1 reports.\n
+read_reports_access_no_clear       You do not have access to clear the reports.\n
+read_reports_cleared               The reports have successfully been cleared.\n
+read_reports_access_no_read        You do not have access to read the reports.\n
+chat_message_report_message_empty  Your report cannot be empty.\n
+chat_message_report_respond_ok     Your report has been saved.\n
+chat_message_report_respond_no     Your report was not saved. Please report this issue.\n
+chat_message_report_read_usage     /reports read <line number>\n
+chat_message_report_read_none      Report \1 does not exist.\n
+
 authority_blacklist_help    Comma separated list of authorities your server should refuse to query.
 authority_whitelist_help    If non-empty, only authorities on this comma separated list will be queried by your server.
 trust_lan_help              If set to 1, the server assumes that your LAN is safe and that nobody can run a pharming server on it.
Z-Man wrote:
aP|Nelg wrote:> {More of a client thing}: Color tab completion. (Colored player's names in tab completion)
I'd take that too, even though...
Jip's patch should work; the line numbers appear to have changed

Post Reply