Commit Graph

287 Commits (master)

Author SHA1 Message Date
Sven Eberhardt 6407c7cd2b Some more fixes for time_t change.
Some format strings had to be adjusted and clients always had ping timeout on join. Let's hope this fixes it.
2013-12-01 16:34:47 +01:00
Sven Eberhardt 21d05fa97f Build fix for 32bit Windows autobuilds (I hope).
Note that the code is still broken if timeGetTime() overflows while the engine is running (related to issue #251).
2013-12-01 14:49:06 +01:00
Nicolas Hake 52fd2679cd Fix line endings broken by ecf538c, 7b9c1d5, and ceca8b8 2013-11-29 14:18:48 +01:00
Tobias Zwick ceca8b8fc7 add SoundAt function in C4Script (part of #238), document
also, extend the documentation for Sound with previously undocumented parameters; threw out undocumented and also unused "multiple" parameter.
2013-11-29 18:20:36 +07:00
Tobias Zwick 7b9c1d5a9e refactor: consistently use time_t t... variables for times in network system, scheduler, gui
The network used to cast GetTime() to int, but GetTime() is an unsigned long. This might cause problems if GetTime() returns big integers (see #251). To solve this, the StdSchedulerProc interface had to be extended with another function in order to eliminate the magic return value -1 of GetNextTick for "no scheduled execution".
2013-11-29 17:28:04 +07:00
Tobias Zwick ecf538cd1f refactor: consistently use time_t t... variables for times in sound system, stats, application and player controls 2013-11-29 14:16:14 +07:00
Tobias Zwick 8da7c6b20f add internationalization for responses from the masterserver/league server 2013-11-06 13:35:27 +07:00
Tim Blume 240193ad5a Remove remains of Direct3D support
Direct3D hasn't worked for more than a year now, and there don't seem to
be any efforts to revive it. Remove it and concentrate on better OpenGL
support.
2013-11-02 21:39:34 +01:00
Nicolas Hake fd193c03dd Add C4ControlPlayerMouse to packet handler data, so unpacking it works 2013-09-08 14:38:41 +02:00
Nicolas Hake 9b82abb8a0 Use control packet for mouse drag/drop and hover
This removes some more pre-assembled C4Script code going across the
network unchecked.

Part of #936.
2013-09-04 19:58:57 +02:00
Nicolas Hake 9604753e93 Player self-management: Use dedicated control packets
Instead of sending pre-composed C4Script code across the network, make
player self-management (surrendering, team changes etc.) send a
dedicated control packet. This means less network traffic, and also a
smaller attack vector for malicions C4Script injection.

Part of #936.
2013-09-02 22:22:29 +02:00
Nicolas Hake f2dba4a6b3 MsgBoard commands: Handle and assemble on clients
MsgBoard commands used to be evaluated on the issuing client. Malicious
clients would be able to insert arbitrary C4Script code to be executed
instead of the scenario-defined command; other clients would not be able
to tell the difference.

Instead, we now only send the command identifier, issuing player and
command parameter. This is still not perfect because clients can
insert any player they want, but it's better than before.

Part of #936.
2013-09-02 20:47:03 +02:00
Nicolas Hake f920e853e0 MsgBoard replies: Remove detour via C4Aul
Instead of having message board replies synced via script calls, send a
dedicated control packet.

Part of #936.
2013-09-02 20:19:37 +02:00
David Dormagen 9ad9a67939 Merge branch 'master' into Menus
Conflicts:
	src/script/C4StringTable.cpp
	src/script/C4StringTable.h
2013-04-07 23:02:36 +02:00
David Dormagen c2ba7e65d7 improved menu functionality; added test scenario and helper objects 2013-04-04 18:36:27 +02:00
Nicolas Hake 459fce0758 Replace std::auto_ptr with std::unique_ptr
std::auto_ptr has awkward copy semantics and is deprecated in C++11.
2013-03-26 15:43:01 +01:00
Peter Wortmann 43bbcecd99 Ignore "would block" errors from UDP sendto
Given that SimpleUDP makes no promises on delivering data anyway, it's okay
to just drop packets silently.

While I'm at it, it's probably a good idea for non-Windows system to
set sockets as non-blocking too, as well as C4NetIOUDP to be more
consistent with its handling of errors along these lines.
2013-03-07 21:26:32 +00:00
Peter Wortmann 4b63957285 Close connection if a packet can't be sent
I am still completely mystified why this seems to happen so often in
practice. Hopefully the extra logging will give us some clues in
future. And closing the connection immediately gives us a small chance
at recovering from this situation.
2013-03-02 20:51:17 +00:00
Günther Brammer 864c5c7ea8 copyright notices update 2012 2013-01-12 16:31:40 +01:00
Günther Brammer a1589a48b6 Make network lobby command line processing available to the editor and dedi
Most of the processing was already done by C4MessageInput::ProcessInput and
C4MessageInput::ProcessCommand. Simply move the Lobby-only commands there,
too, and make them work without a Lobby MainDlg. This required almost only
cosmetic changes.
2012-11-30 22:20:15 +01:00
Günther Brammer cb74726158 Fix some BSD portability issues
Thanks to mdg on the forum and the Debian buildd.
2012-11-19 17:23:31 +01:00
Nicolas Hake 102ac08c2e Don't assume char to be unsigned when generating packet header
OR'ing an enum value and a char with its highest bit set sign-extends the char.
On compilers with signed chars, this means you end up with a negative integer,
which can't be narrowed to uint8_t at initialization (which is what PacketHdr's
first member is).
2012-11-17 22:53:56 +01:00
Peter Wortmann afe653baae Use uint8_t consistently for UDP status packet byte
Thanks to pkern for spotting this.
2012-11-17 17:40:00 +00:00
Philipp Kern 32d66d79aa C4Network2.h: drop unused declaration InitHostResources 2012-10-21 22:21:17 +02:00
Philipp Kern e037300801 Fix spelling mistake: ressource -> resource. 2012-10-21 22:20:43 +02:00
Armin Burgmeier b4aafdd874 Remove build number aka C4XVER4 2012-10-18 23:54:50 +02:00
Sven Eberhardt db84b849b1 /sound reenabled. Sound-creating client now shown in client list box (F4). No sounds played when client is ignored. 2012-10-13 13:37:59 +02:00
Sven Eberhardt de7b30d82a fix saving of resources loaded in the network lobby 2012-07-12 19:26:45 +02:00
Günther Brammer a528b0d76e Silence some g++ warnings 2012-06-15 18:16:49 +02:00
Günther Brammer 1929e8d779 linux: add CLOEXEC flag to miscellaneous calls 2012-03-05 02:48:27 +01:00
Günther Brammer 3755a36dd1 linux: Add SOCK_CLOEXEC to socket calls 2012-03-11 00:50:51 +01:00
Günther Brammer b4fd8fcd15 linux: Add O_CLOEXEC to various open calls
This should prevent some file descriptor leakage from forks that
some libraries we use do.
2012-03-05 01:33:02 +01:00
Günther Brammer 3ec624bb7a win32: Clean up some leftover old frontend User Messages 2012-03-04 19:15:16 +01:00
Armin Burgmeier c09b24125c linux: Fix a crash when getifaddrs returns NULL for an address (#713) 2012-02-14 21:17:26 +01:00
Sven Eberhardt 95582747db Fix random team distribution when a player leaves during lobby time
Also allow random/random surprise teams in AutoGenerateTeam mode
(always creates two teams)
2011-11-08 17:27:32 +00:00
Peter Wortmann 8b9ace23c9 Fixed the surrender dialog showing after declined kick vote 2011-05-08 22:36:48 +02:00
Armin Burgmeier 23d54ea2c9 Implement UPnP for Linux using libupnp 2012-01-21 02:04:14 +01:00
Nicolas Hake 3738069ecd MinGW: Define UPnPNAT CLSID/IID values 2012-01-15 23:22:01 +01:00
Nicolas Hake 33b8fa83d3 Correct file path capitalization 2012-01-15 22:45:04 +01:00
Nicolas Hake cca86151fd Move #include to .h to avoid defining a function with an incomplete type parameter 2012-01-15 22:36:27 +01:00
Nicolas Hake 067456d213 Remove superfluous includes 2012-01-15 22:35:22 +01:00
Nicolas Hake 683800c33c win32: Add UPnP port mapping support 2012-01-15 21:27:16 +01:00
Armin Burgmeier 98f4b6f1c6 Print a warning instead of a failed assertion if C4Network2IO broadcast fails 2011-12-29 21:51:52 +01:00
Armin Burgmeier c17e272b38 Allow PID_ConnRe packets from not-yet-accepted connections
This fixes joining games in local networks where the PID_ConnRe
packet can arrive earlier than the main thread manages to flag
the connection as accepted.
2011-12-29 19:39:25 +01:00
Armin Burgmeier 934637f8f0 Linux: Obtain local addresses by enumerating network devices
Instead of resolving local hostname. This makes network work with erroneous
or missing entries in /etc/hosts.
2011-11-20 20:45:58 +01:00
Günther Brammer b911630578 Replace OpenSSL SHA1 implementation with one copied from boost/uuid
Although the code already uses boost, boost/uuid hides the sha1
implementation in a deeply nested namespace, which is just too bizarre to
use. Also the name of that namespace suggests that it is just an
implementation detail that could go away without notice.
2011-01-10 21:30:40 +01:00
Günther Brammer 5f2f995852 Unify the #include blocks a little bit
One line for C4Include.h, one for the .h corresponding to the .cpp, one
empty line, the other C4* includes, another empty line, external headers.
2011-11-01 23:17:41 +01:00
Peter Wortmann 6835b7939d Fixed some warnings, security 2011-10-08 13:02:15 +01:00
Günther Brammer 2b6f4432de Rename lpDDraw to pDraw 2011-10-03 16:30:18 +02:00
Günther Brammer 529247da2c C4Network2ClientDlg does not label active or remote clients
Instead, silence stands for that, and inactive and local clients are
called out.
2008-06-11 22:17:42 +02:00
Günther Brammer dfc799aa27 Rename C4Group_GetFileCRC/SHA1 to GetFileCRC/SHA1
These functions aren't used for files in groups and
consequently broken for them. Remove the dead code.
2011-09-15 20:16:00 +02:00
Nicolas Hake a04b06f98f NetIO: Cast test packet payload to unsigned
rand() returns a signed integer, while the PacketHdr structure
has an unsigned packet number field. According to ISO/IEC 14882,
implicitly narrowing a value type in an initializer list is not
allowed [dcl.init.aggr p2].
2011-09-28 00:56:11 +02:00
Nicolas Hake 2aac466306 Net2Discover: discovery port should be unsigned 2011-09-28 00:52:12 +02:00
Nicolas Hake e0610576bd Return NULL instead of ((T*)false) from some functions 2011-09-28 00:48:46 +02:00
Günther Brammer 9bc61db360 copyright notices update 2011 2011-09-01 16:58:52 +02:00
Nicolas Hake fe747db554 Clean up copyright notices
Use real names for copyright attribution wherever they are known,
drop duplicates
2011-09-01 12:47:54 +02:00
Nicolas Hake 0f4e6e8ccd win32: Use wide variants of CRT file access APIs 2011-08-11 15:46:06 +02:00
Nicolas Hake b2e83c3cb2 Replace raw CRT file access API calls with StdFile equivalents 2011-08-11 15:45:27 +02:00
Günther Brammer 7edb33642f win32: Use Unicode APIs for ExePath and TempPath 2011-04-02 22:50:54 +02:00
Tobias Zwick f025edb4a9 removed Portraits
+ CustomMessage now uses a normal picture of a definition/object
+ BigIcon is now the small (and only) "Portrait" the player chan choose
+ In future, one could of course make the max size of the BigIcon bigger
2011-08-05 14:58:16 +02:00
Tobias Zwick 221aae1bf5 fixed some ridiculous formatting of consts 2011-08-04 01:30:37 +02:00
Günther Brammer 9b3afcef04 Remove IDS_LANG_CHARSET and supporting code, everything is in UTF-8 now 2011-04-09 02:51:57 +02:00
Günther Brammer 5b808be269 Remove some unused variables
gcc 4.6 finds variables that are write-only.
2011-03-28 19:31:28 +02:00
Günther Brammer 0c5f1be59d Fix network connection error messages after OSTR removal
Using const char * as an out parameter doesn't work. Finally noticed by
gcc 4.6.
2011-03-28 18:29:19 +02:00
Julius Michaelis 9e1bff2e17 Save IRC clients joined channels 2011-03-21 22:39:36 +01:00
Julius Michaelis 61d93c39cf Fixed some files which didn't include C4Include properly (all except C4Globals.cpp caused by 17d0ceb9ef2f) 2011-03-14 16:32:01 +01:00
Günther Brammer 6c2a89eaf8 Replace timeGetTime with a platformneutral GetTime wrapper 2011-03-13 17:25:35 +01:00
Armin Burgmeier 884809e8f2 Merge filename extension changes 2011-03-13 17:15:40 +01:00
Armin Burgmeier 2a2408f9a8 Change .c4p extension to .ocp 2011-03-13 16:39:48 +01:00
Armin Burgmeier eaf62f71f9 Change .c4f extension to .ocf 2011-03-13 16:38:33 +01:00
Armin Burgmeier 41a1b5867d Change .c4g extension to .ocg 2011-03-13 16:16:45 +01:00
Armin Burgmeier e282bf9a9c Change .c4s extension to .ocs 2011-03-13 16:11:55 +01:00
Günther Brammer c49f8b32d5 win32: wrap all windows.h-includes to always undef troubling macros 2011-03-13 15:48:45 +01:00
Günther Brammer 8569eaab8c win32: Do not include windows.h from PlatformAbstraction.h
A few windows headers are still included, but not the big offenders
rpcndr.h, wingdi.h and winuser.h. Unfortunately, the latter two need to be
included from StdWindow.h, so still wind up in a lot files, which means
some of the #defines in them need to be undone. To avoid doing that in
multiple places, a few more files include StdWindow.h now.
2011-03-11 03:48:25 +01:00
Günther Brammer 040ebfa612 Replace ZeroMemory(p,l) with memset(p,0,l) 2011-03-12 14:59:41 +01:00
Günther Brammer 2820716057 Include fewer headers from C4Game.h so C4NetIO.h isn't included from there 2011-03-11 03:43:38 +01:00
Günther Brammer 81d64df737 Do not use Windows' RGB macros for BGR colors 2011-03-11 03:37:27 +01:00
Julius Michaelis 98d17cc4d3 Store record state 2011-03-09 23:28:19 +01:00
Armin Burgmeier 9f74506e9b Support loading game data from system path 2011-01-06 21:18:13 +01:00
Martin Plicht 872fbe162f C4Network2: Fix comment typo 2010-12-24 14:17:42 +01:00
Martin Plicht afd09a2e64 C4InteractiveThread: Don't include StdWindow.h but boost/function.hpp 2010-12-24 14:17:28 +01:00
Tobias Zwick 6da6f6a73b fix: Version information from masterserver is correctly parsed
PeterW changed some stuff about the INI parser. I adjusted the parsing of the version info from the masterserver to fit his change
and let the C4Network2RefClient inherit from the C4Network2UpdateClient (as refclient does the same as updateclient only more) while I was at it.
2010-12-27 01:07:59 +01:00
Tobias Zwick 311dcfbb7a Clonk client redirects user to download page if new version is available but not as update 2010-12-27 00:31:25 +01:00
Günther Brammer be342d4a51 copyright notices update 2010
This time with more manual checking and using git blame -M -C, so that
a few cases of copied code get a copyright notice corresponding to
their initial introduction.
2010-12-23 01:01:24 +01:00
Peter Wortmann f00ec07a7b Reference: Compile UpdateURL as RCT_All, set default so parsing won't fail because of it. 2010-12-19 20:16:18 +00:00
Günther Brammer 719ed39632 Remove FairCrew and permanent Physicals 2010-12-10 01:06:38 +01:00
Sven Eberhardt e2a580fd55 revive MSVC10 memleak checking and fix a few memleaks 2010-12-07 23:43:00 +01:00
Günther Brammer ccf84f5dbe c4group: Remove Maker information.
It is useless without the shareware registration providing a name.
2010-12-05 18:57:06 +01:00
Günther Brammer 0d59854c5c GUI: Remove superfluous checks for IsGUIValid() and GetScreenS()
Some of them should rather check whether the user has closed the window,
though.
2010-10-30 02:08:58 +02:00
Günther Brammer 75c2b21ee8 GUI: Remove superfluous checks for pGUI 2010-10-30 01:47:50 +02:00
Tobias Zwick 9f8fa02b8e new update system 2010-12-01 21:37:47 +01:00
Tobias Zwick 56937d4179 IRC-chat fixes
+ Now can join #play-clonk. Anything that adheres the pattern #*clonk*
+ /help actually works now
+ /query nickname message - does not create a chat with "nickname message"
2010-11-25 19:02:23 +01:00
Nicolas Hake 0a932c656f Disabled 'League' button (#479) 2010-11-09 13:17:02 +01:00
Günther Brammer 16609432cb Remove Regjoinonly flag, unregistered users can now join all games
The commandline option already went away anyway.
2010-10-04 18:07:46 +02:00
Günther Brammer 8e2ae2f543 Replace Application.DDraw with lpDDraw everywhere
There's no need for two globals always storing the same value.
2010-09-28 20:35:26 +02:00
Günther Brammer a7e4dd9a9c Rename some fullscreen flags to editor 2010-09-28 20:16:33 +02:00
Günther Brammer 17016a6695 Version: Reduce version number from five numbers to four
Removing C4XVER4 and renaming C4VERBUILD to C4XVER4. Also, make the
Makefile.am read the version from the Version.txt and generate C4Version.h.
2010-09-25 00:43:30 +02:00
Julius Michaelis dcd3065243 add #openclonk* to allowed IRC-client channels (#381)
change default channel to #openclonk-lobby
2010-09-16 23:22:38 +02:00
Günther Brammer e109df627c Remove a lot of old obsolete palette code
Hardcode the few remaining palette references instead. We might want to
include some method to customize some colors again, but not for debug
display and such things.
2010-06-29 01:02:16 +02:00
Günther Brammer 46aa12def4 Merge C4GUI::Resource into C4GraphicsResource
Both classes did the same thing at the same time, with the only difference
that C4GUI::Resource was vaguely more associated with GUI stuff. Some
time ago, C4GUI::Resource could be freed during the game, but not anymore.

This saves some lines of code and one redundant class, but shouldn't change
anything besides progress bar being textured a little earlier during
startup.
2010-06-27 02:42:48 +02:00
Sven Eberhardt 65b73b7177 SendCursorPos controls issue CON_CursorPos (#289) 2010-05-07 15:57:56 +02:00
Armin Burgmeier 9f65838ae8 Fix a couple of compiler warnings 2010-04-28 23:43:25 +02:00
Nicolas Hake 73ec7de7b7 Clarify pointer ownership semantics 2010-04-03 12:35:12 +02:00
Benjamin Herr a339254617 Fix display of _CHANNELNOTALLOWED message 2010-04-02 16:07:04 +02:00
Benjamin Herr 8f3aaabf61 Let C4InteractiveThread post arbitrary functors 2010-04-02 16:06:45 +02:00
Armin Burgmeier c2924041c9 Fix seperate->separate everywhere 2010-04-01 23:08:06 +02:00
Armin Burgmeier d52fd9eadb Pass correct poll result (revents) to glib mainloop
This fixes saving games in developer mode on Linux
2010-03-31 19:14:10 +02:00
Julius Michaelis 9fbacd33db Fixed IRC client connect error when trying to connect without RealName 2010-03-30 21:31:18 +02:00
Benjamin Herr 84f54c2972 Use first participant if network nick is empty 2010-03-28 23:41:56 +02:00
Carl-Philip Hänsch 649df64f1a Allow ignoring clients in the game lobby 2010-03-28 21:33:51 +02:00
Benjamin Herr 4378de147c Rerun astyle with missing \ added 2010-03-28 20:58:01 +02:00
Benjamin Herr 27287b981f Reformat everything according to style guidelines
as per http://forum.openclonk.org/topic_show.pl?tid=208
and http://wiki.openclonk.org/w/Style_Guidelines
via astyle
  --brackets=break
  --indent=tab=2
  --keep-one-line-statements
  --keep-one-line-blocks
  --indent-namespaces
  --convert-tabs
  --recursive
  --exclude=zlib
  --exclude=tinyxml
  src/\*.h src/*.cpp
2010-03-28 19:58:21 +02:00
Günther Brammer b4e37b070b Change all indentation with spaces to use tabs instead
This is a whitespace-only patch. Hopefully, it'll only affect rarely-changed
parts of the engine, since all regularly maintained pieces should already
use tabs.
2010-03-27 17:05:02 +01:00
Günther Brammer 164ce843cd Consolidate computername and network nick into one
The distinction was arbitrary and useless.
2010-03-22 16:18:03 +01:00
Sven Eberhardt 2b39de9600 hgrevision mismatch message localization 2010-03-22 22:49:53 +01:00
Sven Eberhardt 5e48fd1a15 hg revision stored in engine and checked in network (MSVC only) message fix 2010-03-22 13:42:18 +01:00
Sven Eberhardt 9b7009de94 hg revision stored in engine and checked in network (MSVC only) 2010-03-22 13:41:14 +01:00
Günther Brammer e30ff99d6a Remove all superflous #include <Standard.h>
Standard.h is included by C4Include.h, and every file includes that.
2010-03-04 22:11:12 +01:00
Carl-Philip Hänsch 411a61276b Removed more shareware restrictions
Lobby: Desaturation filter and watermark on unregistered players gone
Startup: Doesn't show "Unregistered" anymore
About: No "register now button"
Network: /regjoinonly switch removed
2010-03-02 10:03:29 +01:00
Günther Brammer ff8d950e85 Remove C4ENGINE define
Most files using it weren't used by c4group-the-application anymore, and
the remaining stuff can be dealt with by using stubs or the same code in
both cases.
2010-02-17 22:59:46 +01:00
Benjamin Herr 00c747aebe C4NetIOTCP: Removed assertions from bug #101
The non-winsock part of the code was making some funny assumptions about
the the connection/peer lists staying consistent with the pollfd array,
so we use a pollfd map instead.
---
 src/network/C4NetIO.cpp |   32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)
2010-02-02 16:41:18 +01:00
Benjamin Herr df0ff9ef00 C4NetIO::Execute: Extend std::vector lifetime as something points to it
In the not-STDSCHEDULER_USE_EVENTS case, the fds pointer will point to
the elements of a vector with automatic storage duration and then
outlive its lifetime, causing undefined behaviour.
---
 src/network/C4NetIO.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
2010-02-02 15:22:33 +01:00
Benjamin Herr f3b35227ea avoid lots of gcc warnings 2010-01-25 05:00:59 +01:00
Günther Brammer bf1b347d1a netio error message fix 2009-11-03 00:59:27 +01:00
Günther Brammer e592ca643c Move prototypes back to C4Prototypes.h 2010-01-02 01:19:42 +01:00
Sven Eberhardt 8b4006da08 fix scheduler blocking by unblock proc 2009-12-31 18:10:55 +01:00
Sven Eberhardt f0e361e302 fix CID_PlrControl in network 2009-12-30 01:56:52 +01:00
Tobias Zwick edec15d64f merge 2009-11-30 17:24:14 +01:00
mizipzor a53dae0c1b Fixed compilation in MSVC2010 2009-11-25 19:38:54 +01:00
Armin Burgmeier 49e607bab0 Added includes and forward declarations, fixing the build 2009-10-26 00:09:34 +01:00
Nicolas Hake b3ab7fab5b Strip down C4Include.h to encourage self-sufficient sources 2009-10-23 09:29:58 +02:00
Nicolas Hake 52bde5a579 Remove BIG_C4INCLUDE define 2009-10-20 06:21:12 +02:00
Tobias Zwick f584896446 merge 2009-10-08 20:51:31 +02:00
Günther Brammer 6ca2ed3b6a C4PktBuf: Use StdCopyBuf instead of StdBuf as member variable
That way, the automatically generated operator= actually works instead of crashing.
2009-08-26 01:20:01 +02:00
Günther Brammer 9a8b5dd739 Replace BOOL by bool, TRUE by true, FALSE by false 2009-08-15 20:50:32 +02:00
Sven Eberhardt df6010a148 merge 2009-08-12 17:27:43 +02:00
Günther Brammer 572d00c32e Move all source files
This might make stuff easier to find.
2009-08-10 17:59:18 +02:00