問題タブ [crysis]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
1 に答える
142 参照

c++ - Obtaining Current Network Rate

I would like to obtain the current network transfer rate of download/upload. This is for a C++ gameserver DLL and the primary objective of this is to best predict the upper-latency limit to kick players from the server, when their latency is too high. Basically, a players' ping influences the fluency of their movements, and higher latency leads to more delayed movement, meaning that we need to get rid of the player if it becomes too high. This is to mainly keep players happy.

Via the internal functions of the gameserver I can get the internal process upload/download rates, but I cannot get Windows'.

I've looked pretty much everywhere, and have done so on-and-off for quite a few months. The only solutions I can find don't work, and the rest are specific to Linux. The supported platforms (if it matters) are Windows Server 2008 R2 and Windows 7. The compiler is Microsoft Visual Studio Ultimate 2013's default compiler.

Edit

Forgot to mention that my gameserver DLL will eventually be running on a dedicated server with no less than four IPs, so it needs to be able to measure the connection upload/download (at the current rate) for all the IPs collectively.

0 投票する
2 に答える
412 参照

c++ - Unexpected characters in console output

I am programming a new server-client network for the game Crysis Wars. I have a function that centers a string to the amount of characters supported per-line in the console window. The window fits 113 characters, but I have set the maximum character width in my function to 111 as to fit text nicely.

This is my function:

This function is from a question I asked last year, but I however am not sure whether I ended up using it or not in past projects.

I am attempting to use this function in this context (the CryLogAlways function simply logs the string to the game/server logfile and prints it):

However the output is:

enter image description here

Likewise as @deW1 requested, I have a similar output with CryLogAlways(CenterText("X").c_str());:

enter image description here

Why am I getting this output, and how can I fix this?

0 投票する
2 に答える
2284 参照

c++ - 文字列で「%20」を使用できないのはなぜですか?

この質問で見つけた関数を使用して、すべてのスペースを「%20」に置き換えるように調整しました (おそらく、はるかに効率的に実行できます!):

ただし、 などの文字列に使用しようとするとLocal Live Test Server、出力は次のようになります。

ここに画像の説明を入力

私の最後の質問は問題を扱っており、私が使用しているゲーム SDK (CryEngine2)の内部型を指していることがstringわかりました。私はこれに対抗するために現在使用しています。stringtypedefCryStringstd::string

この問題は、この変換が発生してデータがデータベースに送信された後に使用するデータベースにも反映されます。

ここに画像の説明を入力

%20この方法で (おそらく他の URL エンコーディング記号も)使用できないのはなぜですか? また、これを機能させるにはどうすればよいですか? 自分で問題を解決するためにこれについて調査を試みましたが、関連するものは何もありませんでした。

*it = (char)"%20";の代わりにを使用してみまし*it = (char)"%20";たが、実際には0、スペースを に置き換えるのではなく、文字列に表示されている を削除します%20